Jump to content
  • Advertisement

Archived

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

Tylon

Turning a direction vector towards another?

This topic is 5190 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

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

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!