Jump to content
  • Advertisement
Sign in to follow this  
MetaKnight

People Standing on the Earth

This topic is 4812 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

Okay so I have people walking on a sphere earth. I want them to be orientated so they stand and their feet are always on the ground. So basically so they face the sphere normal. I got their position fine, and the normal I have also, so I just need a way to rotate them properly. I thought the LookAt Camera command might work, but it seems really funky. Cause it needs a position, but do I need to put position if I want just orientation? Also it needs the up vector, but technically there is no up in this world. Anyone know how this would work? In any way?

Share this post


Link to post
Share on other sites
Advertisement
im assuming this is done in 3d, ive done this in 2d but hopefully it translates. you should know the position of the center of the 'earth', as we'll call it. then you need to find the angles of position based on the coordinates of the model. xy, and yz, or something like that. do a depth angle and rotate accordinglhy, and then do a height angle and rotate accordingly, im not sure exactly how this translates into 3d because i havent done any 3d programming yet but it worked for me in 2d.

Share this post


Link to post
Share on other sites
If you want them oriented so that they are 'standing' on the surface of the sphere, the you do indeed have an 'up' vector: its the direction vector from the center of the earth to their position on the surface of the earth.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!