Jump to content
  • Advertisement
Sign in to follow this  
papa

Extracting Rotation Vector from 3-by-4 Matrix

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

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.

Share this post


Link to post
Share on other sites
Advertisement
Well I am surprised you are surprised :) google it!
http://www.purplemath.com/modules/matrices.htm

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 |

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!