Archived

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

Tylon

Turning a direction vector towards another?

Recommended Posts

I have a direction represented by a normalized vector, and I want to be able to turn that direction towards another direction by a certain amount (ie, not set it to the other direction, but ''bend'' the direction towards the other direction). Can anyone tell me how I could do that? Sorry if its been asked before.

Share this post


Link to post
Share on other sites
First get the angle between the two vectors. That''s the total angle. Next, take the cross-product of the vectors. That''s the normal to the plane of rotation. Use that axis and part of that angle to build a rotation matrix. Multiply the first vector by that matrix. Rock on.


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites