• Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Matrix Inverses

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

10 replies to this topic

#1joeG  Members   -  Reputation: 172

Like
Likes
Like

Posted 23 November 1999 - 12:41 PM

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?

#2Alastair  Members   -  Reputation: 122

Like
Likes
Like

Posted 22 November 1999 - 01:11 PM

Cramer's rule is best for small matrices. Check out the Small Matrix Library on www.intel.com. It's got C++ source code.

#3CodeDemon  Members   -  Reputation: 361

Like
Likes
Like

Posted 22 November 1999 - 01:20 PM

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].

#4joeG  Members   -  Reputation: 172

Like
Likes
Like

Posted 22 November 1999 - 06:27 PM

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?

#5Splat  Members   -  Reputation: 122

Like
Likes
Like

Posted 22 November 1999 - 06:57 PM

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

#6Chappa  Members   -  Reputation: 122

Like
Likes
Like

Posted 23 November 1999 - 06:15 AM

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?)

#7joeG  Members   -  Reputation: 172

Like
Likes
Like

Posted 23 November 1999 - 08:57 AM

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?

#8Splat  Members   -  Reputation: 122

Like
Likes
Like

Posted 23 November 1999 - 10:21 AM

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

#9joeG  Members   -  Reputation: 172

Like
Likes
Like

Posted 23 November 1999 - 10:40 AM

>>for a while,
meaning it's expensive?

#10Splat  Members   -  Reputation: 122

Like
Likes
Like

Posted 23 November 1999 - 11:46 AM

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

#11CodeDemon  Members   -  Reputation: 361

Like
Likes
Like

Posted 23 November 1999 - 12:41 PM

I use inverse matrices for fast pre-transformation lighting and poly culling. This way, I can cull and light polys before transforming them to world or camera coordinates.

VTune is cool, I won a copy of it at the XGDC and I must say, knowing what's included with it now, I'd buy it. =)

You get the Intel ICL C++ optimizing compiler plugins for VC++, interactive assembly tutorials, almost all of their docs in *.pdf format, a profiler and bounds checker, and a lot of other things. I'm impressed.

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS