• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

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

# Extract vectors out of matrix?

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.

4 replies to this topic

### #1Samurai Jack  Members

Posted 14 January 2013 - 12:57 PM

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]

### #2DDoS  Members

Posted 14 January 2013 - 03:58 PM

It's totally possible, but too complicated to be useful
http://callumhay.blogspot.co.at/2010/10/decomposing-affine-transforms.html
http://en.wikipedia.org/wiki/QR_decomposition
http://en.wikipedia.org/wiki/Polar_decomposition

where would you use this ?

### #3Álvaro  Members

Posted 14 January 2013 - 04:16 PM

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?

### #4Samurai Jack  Members

Posted 15 January 2013 - 12:58 AM

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.

### #5Álvaro  Members

Posted 15 January 2013 - 09:37 PM

Converting a rotation from matrix representation to Euler angles is the kind of thing you can easily learn from Google.

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.