Sign in to follow this  

How to orient an aircraft with earth

This topic is 4543 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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.

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, that's what I mean. I want to make my aircraft flies parallel to the ground.
So how to align my aircraft normal with the normal of the sphere surface? What kind of rotation should I make?

Share this post


Link to post
Share on other sites
If your planet has radius R and its center is at (0,0,0), then if the plane is located at location (x,y,z), the "up" normal at that location will be (x,y,z)/sqrt(x2+y2+z2).

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)?

Share this post


Link to post
Share on other sites
The axis of rotation is the cross product of the current up vector and the desired up vector. The angle, is the angle between the two vectors.

Share this post


Link to post
Share on other sites

This topic is 4543 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this