Jump to content
  • Advertisement

Archived

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

Sander

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.

If you intended to correct an error in the post then please contact us.

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 [Lone Wolves GD][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]

Share this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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.

maybe using quaternions for rotating would help you more?


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

Share this post


Link to post
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
[Lone Wolves GD][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!