PDA

View Full Version : rotation/translate vs. gluLookAt



Po
11-20-2000, 07:51 PM
I'm creating a small 3d world and so far for moving around I have been just moving the camera using gluLookAt. Would using rotation and translation instead be any improvement in speed?

DPalomo
11-20-2000, 08:52 PM
I don't think doing several translation/rotation calls will improve the performance of your application. gluLookAt() does only one matrixmult with the modelview matrix. When you call glTranslate() once and glRotate() three times, once for each axis, you'll have four matrix multiplications, which is, I think, more expensive.

I don't know if you do your own rotations, but if so, you could even speedup your application by using look-up tables for the several sinus/cosinus computations (note: this can lead to some minor significance errors).

Hope this helps,

Daniel Palomo van Es

MarsuGL
11-22-2000, 12:31 AM
I have read in the red book that gluLookAt( ) is using gltranslate( ) and glRotate( )
as encapsulated functions.

11-24-2000, 09:00 PM
Can I see your code?

zed
11-25-2000, 11:31 AM
download mesa and have a look at the source code they use for implementing gluLookAt