Archived

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

F104

Rotation matrix from vector on a sphere...

Recommended Posts

F104    130
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
Eelco    301
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