Hello.
I’m experiencing a weid problem , which I suppose comes from using the gluLookAt function.
I’m rotating an object with a mouse:
void drawingCallBack()
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0.0,0.0, zed, 0.0, 0.0, 0.0,0.0,1.0,0.0 );
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearDepth(1);
glDepthFunc( GL_LESS );
transform(keyvalue, or mouse x,y delta);
glEnable( GL_DEPTH_TEST )
..
draw_body();
..
GlFlush();
}
When I rotate - the body “runs away” in z direction with each transformation.
I’m told to use the gluLookAt only in the drawing callback after the MODELVIEW matrix is loaded.
My question basicaly is - what’s the effect of multiple gluLookAt functions:
gluLookAt(…,zed,…);
gluLookAt(…,zed,…);
…
does it result in equivalent:
gluLookAt(…, n*zed, …) ?
after all it’s just a set of repeated transformations.
Thanks .