#### Archived

This topic is now archived and is closed to further replies.

# Getting eulers from modelview_matrix

This topic is 5759 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

In my OGL app I dump the modelview_matrix in a float matrix[16]. I know that matrix[12] matrix[13] and matrix [14] hold the current x, y and z translation. But how and where can I get the euler rotations from the matrix? Are they in the matrix directly? If not, how do I convert the matrix to get the euler angles? Thanks in advance! Sander Maréchal

##### Share on other sites
To my knowledge, that''s exceptionally difficult, if not impossible. Once more than one angle goes into the modelview matrix, it''s impossible to find out what the angles originally were from just the modelview matrix. Someone asked the same question about two weeks ago, and I think that what I said then about it being impossible was backed up. If anyone knows any mathematical formula that allows extraction of Euler angles from the modelview, and I''m wrong, please post it...

Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You''re Already Here | The Best Film Reviews ]

##### Share on other sites
not eular angles but the top3x3 of the matrix are 3 vectors which represent
side, up + forward

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

##### Share on other sites
i think it''s not possible.
the rotation matrix M for euler angles is computed through:

M = Rz(a)Rx(b)Rz(w)Rx(-b)Rz(-a)

(Rsomethingwhat is a matrix).
so you multiply at the end all five matrices together and get the 3x3 matrix or in homogenous coordinates 4x4 matrix you can read as usual.

ps: i may be wrong with this, i''m a newbie.

##### Share on other sites
I am using quaternations at the moment but sometimes it goes wrong. That''s why I need the eulers so I can check it. I use the quaternations for rotating my tentacle. Sometimes it works (screenshot) but sometimes the rotation goes in the opposite direction (screenshot). For eacht part of the tentacle i have a quaternation which is the rotation relative o the previous bone and the modelview matrix. I need to figure out where it goes wrong and why the tentacle sometimes points in the wrong way.

Sander Maréchal

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633330
• Total Posts
3011388
• ### Who's Online (See full list)

There are no registered users currently online

×