Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Rotation matrix from vector on a sphere...

This topic is 5348 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, I have been away from math, matrix and quaternions too much time. Now I can''t solve this stupid problem. I have a sphere. I have an object moving on the sphere''s surface. I have a vector V from the center of the sphere to the object. What I want is simply have the object''s axis so that its "up" vector lies on V''s rect. Ok... example: the object is a man. If I simply move the man on the surface without rotating it, its feet won''t touch the sphere. I should rotate the man so that its feet always are parallel to the surface. I know it''s a simple matrix operation but I can''t figure it out. Help please! Thx! Bye Bye Etabubu

Share this post

Link to post
Share on other sites
to get the axis to rotate around, do a crossproduct between the two vectors youve mentioned.

to get the angle of rotation use the dotproduct.

then use the correct algorithm to convert this information into the appropriate rotation matrix.

if you dont know how to perform any of the above operations, try google, and im fairly sure it can all be found in the articles section aswell.

Share this post

Link to post
Share on other sites

  • 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!