Jump to content
• Advertisement

# 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

Hello!

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

##### Share on other sites
Advertisement
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

##### Share on other sites

Hi!

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

##### 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

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
Rutin
21
3. 3
4. 4
frob
16
5. 5
• Advertisement

• 9
• 12
• 9
• 33
• 13
• ### Forum Statistics

• Total Topics
632593
• Total Posts
3007277

×

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