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


Getting a rotation matrix based on position and target vector?

Recommended Posts

Hi. Is there a function that I can use to create a rotation matrix based on a position vector and a target (aim at) vector? I tried using D3DXMatrixLookAt() and got some crazy results when I applied the matrix. I have a scale and translation matrix as well and know that order of multiplication matters but none of the combinations worked for me. I can always write some code to use trig functions to figure out degrees or radians but I would much rather know about and use an existing function. Thanks for any pointers.

Share this post

Link to post
Share on other sites