View Full Version : Matrix multiplication

martinjy

05-17-2001, 02:31 PM

I'm dealing with a kind of 3D-fractal based program which heavily uses matrix multiplication. What's the faster way: build my own matrices and multiplication-routines, or use the glLoadMatrix and glMultMatrix?

anybody?

That depends on what you're ultimately trying to do. If you're using these matrices to draw things using OpenGL, then using the OpenGL functions could be a good idea - they could possibly be accelerated, if not in hardware then in SSE or 3DNow!.

However, if your plan is to use OpenGL functions then read the matrix back, then I'd suggest that you stick to your own matrix code, and save the function calls and the data copies involved. You could probably optimise matrix multiplication yourself pretty well.

martinjy

05-18-2001, 03:56 AM

thanx!

I agree with the above. If you find you need the matrix yourself AND your inner loops do a lot of matrix multiplication, you can use Intel's MMX compiler and library (assuming you're WIntel). It uses the SIMD (single instruction multiple data) architecture of the PIII and PIV.

Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.