Turning a direction vector towards another?

Started by
0 comments, last by Tylon 20 years ago
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.
Advertisement
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

This topic is closed to new replies.

Advertisement