Direct3D Rotation Matrix from Vector and vice-versa
- by Beta Carotin
I need to compute a rotation matrix from a direction vector,
and a direction vector from a rotation matrix.
The up direction should correspond to the z-axis,
forward is y and right is x;
D3DXMATRIX m; // the rotation matrix
D3DXVECTOR3 v; // this is the direction vector wich is given
D3DXVECTOR3 r; // resulting direction vector
…