Jump to content
  • Advertisement
Sign in to follow this  
Anddos

Check if a matrix is transposed

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

Advertisement
True, in general it is not possible. If you know a little about the matrix then there is a chance.
Affine transformation matrices have in the last row (0,0,0,1). World and view matrices are usually affine, since they are a combination of affine transformations (rotation, scale, translation ...).
Perspective projection matrices have in the last column (0,0,1,0) if left-handed and (0,0,-1,0) if right-handed.
Orthographic projection matrices have in the last column (0,0,0,1).
If those are transposed you find the entries in the last column/row.

Share this post


Link to post
Share on other sites
Just a small note about why it is not possible in general: Transposed matrix is again just a matrix. It's not different anyhow, there is nothing special on it in general.

It would be possible for a non-square matrix, IF you knew the original dimensions of the non-transposed matrix. If you are working with 3x2 matrices and you have a 2x3 matrix, you can say it probably has been transposed. But as we are in the DirectX/XNA section, you will most probably be talking about 4x4 or 3x3 matrices, so this is not good for you.

Your only hope here is what Tsus said - some special matrices have some columns or rows with "fixed" values that could be used for this.

Share this post


Link to post
Share on other sites

True, in general it is not possible. If you know a little about the matrix then there is a chance.
Affine transformation matrices have in the last row (0,0,0,1). World and view matrices are usually affine, since they are a combination of affine transformations (rotation, scale, translation ...).
...


For sure, inside a given solution the following points will be clear in general, but given as a statement detached from a concrete context I want to comment it:

The above reasoning already makes assumptions about some conventions how the matrix is build:
* are row vectors or column vectors used?
* is the homogeneous co-ordinate stored as the 4-th scalar or somewhere else?
where I already conveniently imply that the matrix is used in a 3D world with a homogeneous extension.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!