Jump to content
  • Advertisement
Sign in to follow this  
poigwym

Quick Way To Invert Matrix

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

I have a look at the  XMMatrixInverse but don't understand how it works ?

He use a determinant , who know what it is ? And who can tell how to use it to compute inverse matrix?

 

Share this post


Link to post
Share on other sites
Advertisement

Hi,

 

Take a look here for the maths of how to invert a matrix.

 

However, i wouldn't really dig deep into the XMMatrix* functions. They should be considered blackboxed, and they also can and do use intrinsics, which means MMX etc instructions to speed them up. This means you won't see actual floating point maths operations if you dig deep enough, just a bunch of inline assembler.

 

Also XMMatrixInverse etc work very well and are scalable, don't consider rewriting them unless you have a really good reason!

 

Hope this helps! :)

Share this post


Link to post
Share on other sites

He use a determinant , who know what it is ?


I do. Think of a 3x3 square matrix as a linear mapping from a R^3 to R^3. Linear mappings have the feature that volumes are scaled by them. The determinant is the scale that the volumes are multiplied by.


And who can tell how to use it to compute inverse matrix?


The most obvious connection is Cramer's rule.

For advanced users: There are other ways in which the determinant is connected to the inverse. One I learned about recently is that the gradient of the determinant (as a function of n^2 variables) is the transpose of the inverse times the determinant squared, or something like that. It turns you can use that fact together with automatic differentiation to compute the inverse in a really whacky way.

Share this post


Link to post
Share on other sites

For advanced users: There are other ways in which the determinant is connected to the inverse. One I learned about recently is that the gradient of the determinant (as a function of n^2 variables) is the transpose of the inverse times the determinant squared, or something like that. It turns you can use that fact together with automatic differentiation to compute the inverse in a really whacky way.
 

If you transpose rotation matrix you get inverse rotation matrix. Ofc it cannot contain translation / scaling / etc.

Share this post


Link to post
Share on other sites

 

For advanced users: There are other ways in which the determinant is connected to the inverse. One I learned about recently is that the gradient of the determinant (as a function of n^2 variables) is the transpose of the inverse times the determinant squared, or something like that. It turns you can use that fact together with automatic differentiation to compute the inverse in a really whacky way.
 

If you transpose rotation matrix you get inverse rotation matrix. Ofc it cannot contain translation / scaling / etc.

 

 

Rather, the transpose of a matrix is equal to the inverse only if the matrix is orthogonal.

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!