Extract rotation angles from model-matrix in OpenGL ES+Android
What is the simplest way to extract the rotation angles around x y and z axes given a modelmatrix? Are there any methods in OpenGL ES available or in Android itself (the Matrix class does not provide any useful stuff i think).
Is it important to know how the model-matrix was created (in which order the angles were multiplied) to extract them again?
Is there a pr开发者_如何学Goedefined order how OpenGL does it?
Does anyone know some good links about this topic?
I do not believe that there is anything "built in" that is going to figure these out for you, although I could be wrong. Scroll down this wiki page on Rotation matrix:
http://en.wikipedia.org/wiki/Rotation_matrix
To the section titled "Conversion from and to axis-angle" once you get into the section on 3 dimensions. The math is surely tricky, but not impossible.
Found this as well, this seems to be much easier to follow:
http://paulbourke.net/geometry/eulerangle/
精彩评论