Rotation matrix for a 3D vector

Posted by Shashwat on Game Development See other posts from Game Development or by Shashwat
Published on 2014-06-07T16:24:45Z Indexed on 2014/06/07 21:38 UTC
Read the original article Hit count: 251

Filed under:
|
|
|
|

I have a direction vector on which I have to apply some rotation to align it to positive z-axis. To use Matrix.CreateRotationX(angle) of XNA, I need the angle for which I'd have to compute cos or tan inverse.

I think this is a complex task to do. Also, eventually those are also converted to sin(angle) and cos(angle) in the matrix.

Is there any inbuilt way to create rotation matrix from a 3D vector?

However, I can write the function but still asking if there is one already there.

© Game Development or respective owner

Related posts about c#

Related posts about 3d