View Full Version : rotation/translate vs. gluLookAt

11-20-2000, 06: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?

11-20-2000, 07: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

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

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

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