Archived

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

Drath

Matrix inverse

Recommended Posts

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
The inverse of 2 is 0.5 meaning 2 * 0.5 = 1 which you could say is the identity matrix of a 1x1 matrix.

Share this post


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