Recommended Posts

Hi all,
I have a 3d aircraft which I want to move along a sphere surface (earth).
My problem is how to align/orient (which is the right word?) the aircraft according to the sphere surface.
I have rotated the aircraft to point to the direction (horizontal direction) it moves, then I translate it to its position. But the orientation of the aircraft doesn't conform with the earth spherical surface. I know the aircraft should be rotated further before being translated to its position.
How the rotation is performed to orient the aircraft according to the sphere surface?
Thanks very much.

0

Share this post

Link to post

Share on other sites

I can't really understand what you're asking, but it sounds like you might trying to get the plane so it flies parallel to the ground? Notice that the vector from the center of the sphere to your airplane is normal to the surface of the sphere, no matter where your plane is. That normal should be the direction that the top of your plane faces (imagine the bounding box around your plane model - you want to align the top face's normal with the normal you found).

Share this post

Link to post

Share on other sites

Yes, I know how to calculate the surface normal. My question is: how to rotate my aircraft so that my aircraft up vector is aligned with that normal?Suppose the surface normal is (x, y, z), and the aircraft's up vector is (0, 1, 0), how to rotate the aircraft so that its up vector becomes (x, y, z)?