Extracting Rotation Vector from 3-by-4 Matrix

Started by
4 comments, last by JohnBolton 19 years, 7 months ago
Hi I would like to ask you how can I extract Vector3D from a 34 Matrix? float m11, m12, m13; float m21, m22, m23; float m31, m32, m33; float m41, m42, m43; Please help! Thanks.
Advertisement
Where on earth did you get a 3x4 matrix from?
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
Well I am surprised you are surprised :) google it!
http://www.purplemath.com/modules/matrices.htm
Those types of matrices are used for solving systems of affine equations in linear algebra. You don't need to extract coordinates from them.

If Mx = 0 has a solution (i.e. det(M) != 0), then Mx = d has a solution if and only if rank(M) = rank(M|d) i.e. number of linearly independent rows & columns of M is the same when the particular solution vector (d) is "joined onto" the matrix (denoted "M|d").

That's probably (alot) more than you need to worry about though. Its not really anything to do with 3d graphics, the transformation matrices are always square in that case.
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
i guess its a 3x4 since the bottom part stores translation?

in that case you can just discard the bottom part and look for the rotation vector described in the top 3x3 part, something that is easily googled.

if this is not the case, im confused aswell.
Frequently a 3x4 (or 4x3) matrix is used in place of a 4x4 matrix. 99% of the time, the missing column (or row) is [0,0,0,1]. So, rather than store those values, they are assumed.

In any case, the math still works:
             | m11 m12 m13 || x y z 1 |  | m21 m22 m23 |  = | x' y' z' |             | m31 m32 m33 |             | m41 m42 m43 | 
which is effectively the same as:
             | m11 m12 m13 0 || x y z 1 |  | m21 m22 m23 0 |  = | x' y' z' 1 |             | m31 m32 m33 0 |             | m41 m42 m43 1 | 
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

This topic is closed to new replies.

Advertisement