People Standing on the Earth

Started by
1 comment, last by Instruo 18 years, 10 months ago
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?
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.
---------Coming soon! Microcosm II.
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.
"Game Programming" in an of itself does not exist. We learn to program and then use that knowledge to make games.

This topic is closed to new replies.

Advertisement