Easy Matrix Question...
If I have a matrix that represents all the translations, rotations, and scaling that I''ve applied to an entity...
Can I now extract a vector out of this matrix that represents the aggregate translation, rotation, or scaling done to the entity?
i.e. RotationVector = GetRotationVec(EntityMatrix)
If so, what is the best way to do this? Is there a shortcut in DirectX8 (i.e. D3DX...)?
You can't. At least not all the aggregate transformations.
You can get one translation, one abitrary rotation, and one scaling.
Normalize the matrix, what you have to divide by is the scaling.
Depending on whether you're using row or column major matrices, the last row or column is the translation, translate by the inverse of the row/column (mult vector by -1)
What's left after removing those two decribes the rotation - tranlate to Q if you want...
At least I think that'll work.
Magmai Kai Holmlor
- The disgruntled & disillusioned
[edit]
You need to undo the translation first.
Edited by - Magmai Kai Holmlor on April 5, 2001 2:05:42 AM
You can get one translation, one abitrary rotation, and one scaling.
Normalize the matrix, what you have to divide by is the scaling.
Depending on whether you're using row or column major matrices, the last row or column is the translation, translate by the inverse of the row/column (mult vector by -1)
What's left after removing those two decribes the rotation - tranlate to Q if you want...
At least I think that'll work.
Magmai Kai Holmlor
- The disgruntled & disillusioned
[edit]
You need to undo the translation first.
Edited by - Magmai Kai Holmlor on April 5, 2001 2:05:42 AM
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement