Reputation: 33
How can I get the camera position from the ModelViewProjection matrix in direct3d 11? I've tried getting the inverse of the matrix and using _41, _42, and _43, but the location was not correct. Is it even possible?
Upvotes: 0
Views: 270
Reputation: 41127
If you have a combined ModelViewProjection matrix then you likely have a number of elements combined so the camera isn't trivial to extract. You typically extract the camera position from the View matrix.
You may want to look at the SimpleMath wrapper for DirectXMaht which implements many common helpers. It uses row-major matrices with right-handed viewing coordinates which is what XNA Game Studio use
Upvotes: 1