Jump to content
  • Advertisement
Sign in to follow this  
Samurai Jack

Extract vectors out of matrix?

This topic is 2074 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



I am wondering, if anyone is capable, to solve thi issue:


I have the following matrix:

          -0.8454   -0.5298   -0.0682    0.0000
           0.1796   -0.4020    0.8978    0.0000
           0.5031   -0.7468   -0.4350    0.0000
         -24.6733  -18.6587   -0.1653    1.0000

I need to extract: translation, rotation (euler angles) and scale out of this matrix.

So basically I need:


Vector3 translation, rotation, scale;


Out of the above vectors, I should be able to reconstruct the upper matrix.

Even if not 100% equal, it should meet the following condition:


When a vector3 [ 1.0, 2.0, 3.0 ] is transformed over the matrix,

we should get a vector3 with following values: [ -23.6501,  -22.2328,    0.2572]


Thank you in advance!

Share this post

Link to post
Share on other sites
The translation is the bottom row. The rotation is the 3x3 matrix just above it. In this case no scaling is necessary because the matrix is a rotation (when multiplied by its transpose you get the identity matrix).

How exactly do you need to represent the rotation?

Share this post

Link to post
Share on other sites



I need it for the FBX SDK. I am writing a converter where I get the "local matrices" out of the file and need to

pass them to FBX as euler angles (yaw, pitch and roll). I am not looking for Axis angles (OpenGL), nor

am I looking for a quaternion, i need yaw, pitch and roll representation.


The FBX SDK has an affine matrix, but I does not decompose the upper matrix correctly. The rotation

is allways wrong. I think it has to to with the north/south pole issues, because, all matrices fail

that have any rotation (x,z,y or yaw,pitch,roll) near 90 or 180 degrees.

Share this post

Link to post
Share on other sites
Converting a rotation from matrix representation to Euler angles is the kind of thing you can easily learn from Google.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!