Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Rotation angles from matrix

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 jtech   Members   

108
Like
Likes
Like

Posted 01 October 2001 - 08:43 AM

Give a 3x3 rotation matrix that was created using a concatentation order of R=X*Y*Z, how do you extract the rotation angles (x,y,z)? I''ve read you should convert the matrix to a quaternion first, but the explanation didn''t include any code. Anyone have some code handy to do this?

#2 LilBudyWizer   Members   

491
Like
Likes
Like

Posted 01 October 2001 - 02:22 PM

I''m not thinking too clearly tonight, but either the rows or columns of your 3X3 matrix are vectors representing the direction and scale of the x, y and z axes. If you use m*v then it is the rows and if you use v*m then it is the columns. That should at least give you a starting point.

#3 jtech   Members   

108
Like
Likes
Like

Posted 02 October 2001 - 08:32 AM

I can easily get the up, right, and direction vectors from a
rotation matrix (it's just the rows or columns of the matrix),
but I think I would be worst off then trying to figure out
the (rx,ry,rz) rotation angles that created the matrix in
the first place.

Maybe I should ask, how do you arbitrarily extract the
rotation angles from a quaternion?

Edited by - jtech on October 2, 2001 3:33:28 PM

#4 jtech   Members   

108
Like
Likes
Like

Posted 02 October 2001 - 09:14 AM

Got it!

Gramphics Gems IV: Eulerang.c, Eul_FromHMatrix and Eul_FromQuat.

Cool, both ways.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.