Reputation: 3440
I have a very peculiar request. I have a view matrix (one used for gD3dDevice->SetTransform( D3DTS_VIEW, &viewMatrix );
) and I need to reverse it to find the yaw, pitch and roll. How can I do that? I have been following the instructions on http://www.toymaker.info/Games/html/camera.html
Upvotes: 1
Views: 233
Reputation: 3970
This is a quite complicated, inexact and ambiguous task. If you can work around your problem by not calculating euler-angles, do it :)
However, here is some reading and also some code for you:
http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToEuler/index.htm
Upvotes: 1