RE: [Algorithms] matrix inverse
Brought to you by:
vexxed72
From: mark_me <ma...@so...> - 2002-02-07 06:56:30
|
Transposing the 3x3 orthonormal matrix is always a good idea , and should be used if you know for sure that the matrix is orthonormal ( specially in articulated objects like skeletons and that stuff ) it's very fast and stable , simply because there is no operation that makes you lose precision. For the translation part of the 4x4 matrix , you need to transform it by the transposed 3x3 matrix first then negate it. if we take a 2X2 rotation with translation as a simple example : |A -B 0| |B A 0| |X Y 1| The Inverse would be : |A B 0| |-B A 0| |-AX+BY -BX-AY 1| The same for 3x3 with translation. -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Peter Warden Sent: February 6, 2002 1:28 PM To: 'Algorithms List' Subject: RE: [Algorithms] matrix inverse Since we're discussing speeding up matrix inversions: In cases where you have 'simple' orthogonal 3x3 matrices containing only rotations and no scaling or skewing, the inverse is just the transpose of the original matrix. One thing I have found occasionally useful in the past is extending this to simple 4x4 matrices containing just a rotation and a translation by transposing the 3x3 rotation part of the matrix as before. Then feed the original translation through this transpose and multiply it by -1 to get the inverted translation. (IIRC? I don't have the code in front of me) Of course you should only use this if your profiler is telling you that doing the inverse properly is a performance problem _and_ you're sure that the matrices you're dealing with are orthogonal. There may be other problems with this approach, YMMV, etc, but it did the job for me at the time. Pete -----Original Message----- From: gda...@li... [mailto:gda...@li...] On Behalf Of Idahosa Edokpayi Sent: Wednesday, February 06, 2002 9:39 AM To: Algorithms List Subject: RE: [Algorithms] matrix inverse I wanted it for an explicit inverse. I actually only use the inverse for the camera so yes that is what I wanted. Idahosa Edokpayi -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Willmott, Andrew Sent: Tuesday, February 05, 2002 9:46 PM To: Algorithms List Subject: RE: [Algorithms] matrix inverse > Well, I have contraditory results from Intel: > > http://developer.intel.com/design/pentiumiii/sml/24504301.pdf > > Cramer's rule seems pretty efficient even with a 4x4. When coupled > with SIMD, it totally rocks! Note that these results aren't inconsistent: Graham's link is measuring Cramer's rule against Gaussian elimination for solving Ax = b, whereas the Intel guys are measuring it against computing the entire inverse iteratively. It's not surprising elimination does better for the first case. FWIW I use cramer's rule for 3x3 and 4x4 matrix inversion and swap to iterative methods thereafter. As everyone else has said, you should be using elimination to solve most Ax = b cases, but having to have an explicit inverse does crop up a fair bit in camera calculations, enough to care about having a fast explicit inverse. Cheers, Andrew _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list |