Hello,
I am a little confused about where to use
the gluLookat function.
I have always used it this way:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(…);
gluLookAt(…);
Then I call glMatrixMode(GL_MODELVIEW);
And do all my drawing stuff, and it works just fine.
But recently I needed to include some Billboards in my app.
I noticed that in all the sample code I have seen about Billboards the gluLookAt function is used before calling glMatrixMode(GL_MODELVIEW);
and all the calculations to make the Billboard face the camera are done taking
the camera rotation from the Modelview Matrix , not the Projection Matrix
I changed all my code to work this way, but the problem now is that when I move the camera, the lights seem to move whit it, this was not happening before.
My question is, where is the right place to
call gluLook at , Projection or ModelView matrix ?