Dororo
Dororo

Reputation: 3440

Reversing a View transform in DirectX

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

Answers (1)

Tobias Schlegel
Tobias Schlegel

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

Related Questions