Matrix Inverses

Started by
9 comments, last by joeG 24 years, 5 months ago
Cramer's rule is best for small matrices. Check out the Small Matrix Library on www.intel.com. It's got C++ source code.
Advertisement
Yep, if you're not using the homogenous coordinates (the w component of each term), you can just swap the rows with the columns. In fact, you just have to swap you matrix indices, which is even faster considering you don't have to create a new matrix. Also, I don't tink you can use the W term (the translation part), but this is alright for lighting and view transformations.

You have a 4x4 matrix:

float matrix[4][4];

The inverse of say element [2][0] is [0][2], or the inverse of [1][2] is [2][1].

Alastair,
intel has a big site, could you narrow it down a little.

CodeDemon,
I remember reading a little on that in Brian Hook's book. You are talking about the transpose, right? or at least a glorified form of the transpose?

joeG
http://developer.intel.com/design/pentiumiii/sml/

Great stuff there, got some PDFs going into the details behind their MMX and SIMD optimized matrix operations.

- Splat

Anyway, what are inversed matrices good for? I know how to do it, but I dont know for what to use them (3d transformations for what?)
Pretty much for transforming world coordinates (or object coordinates if you concactenated the transformation) to the camera's coordinates [relative to the camera]. Pretty crucial step in the whole graphics pipeline if you ask me.

I looked at the intel site, and yes I do agree that 360 or so cycles is the way to go, but the author(s) of the code skipped that important intuitive version. No big deal.

I'm also curious about the role of intel 's c/c++ compiler. Is it supplemental to your compiler or does it stand on its own?

joeG
I've been thinking about purchasing the Intel compiler for a while. Basically, it is standalone, and will integrate / replace the Visual C++ compiler with ease, and even allow switching back and forth.

- Splat

>>for a while,
meaning it's expensive?
joeG
Yeah, $420 for the VTune package which includes the C++ compiler plus other shit. When I need optimization and find that the Intel one works much better (using the evaluation version) I'll buy it, but I have little need now.

- Splat

I've pieced through some Linear Algebra books and have come up with two differnt ways of computing the inverse of a square matrix. Neither of them seem to be good candidates for real-time graphics. Does anyone have a good bit of matrix inversion code?
joeG

This topic is closed to new replies.

Advertisement