Archived

This topic is now archived and is closed to further replies.

Drath

Matrix inverse

Recommended Posts

Drath    138
Am I correct in saying that a matrix multiplied by its inverse = an identity matrix? Then why don''t I get an identity matrix back when I use D3DXMatrixInverse and D3DXMatrixDeterminant to calculate the inverse then multiply the two together? My origional matrix equals camera view * a projection matrix which is then transposed.

Share this post


Link to post
Share on other sites
Drilian    1067
Well to be fair, numbers have additive inverses as well as multiplicative inverses.

2 and -2 are additive inverses.
2 and 0.5 are multiplicative inverses.

Generally, when referring to matrices, you''re referring to the multiplicative inverse (the additive inverse isn''t as useful, especially with 3D work).


Josh

Share this post


Link to post
Share on other sites
Sonicmage    122
There are a couple of things to remember here. First, any square matrix which has a determinant of 0 has an undefined inverse. Second, double-check the order in which you multiply the inverse and the original.

It should be: A*inv(A) = I

Share this post


Link to post
Share on other sites
Drath    138
Well I have got my code working. I put an extra unneeded transformation somewhere though that still doesn''t clear up why the previous part didn''t work considering none of the checking code has been changed.

Share this post


Link to post
Share on other sites