dvm

11-13-2003, 07:41 AM

Hi, does anyone know if the following two pieces of code are identical:

code 1:

glMatrixMode(GL_PROJECTION);

glLoadIdentity();

glFrustum(-50, 50, -50, 50, 10, 100);

gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);

glMatrixMode(GL_MODELVIEW);

glLoadIdentity();

code 2:

glMatrixMode(GL_PROJECTION);

glLoadIdentity();

glFrustum(-50, 50, -50, 50, 10, 100);

glMatrixMode(GL_MODELVIEW);

glLoadIdentity();

gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);

I mean does gluLookAt always operate on the modelview matrix, regardless of the state of the current matrix, or calling it while inside the projection matrix it operates on the projection matrix? Thanks in advance.

Dimitris

code 1:

glMatrixMode(GL_PROJECTION);

glLoadIdentity();

glFrustum(-50, 50, -50, 50, 10, 100);

gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);

glMatrixMode(GL_MODELVIEW);

glLoadIdentity();

code 2:

glMatrixMode(GL_PROJECTION);

glLoadIdentity();

glFrustum(-50, 50, -50, 50, 10, 100);

glMatrixMode(GL_MODELVIEW);

glLoadIdentity();

gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);

I mean does gluLookAt always operate on the modelview matrix, regardless of the state of the current matrix, or calling it while inside the projection matrix it operates on the projection matrix? Thanks in advance.

Dimitris