Rotation matrix for a 3D vector
- by Shashwat
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.