Problem with gluLookAt

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()

  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);   
  glDepthFunc( GL_LESS ); 
  transform(keyvalue, or mouse x,y delta);
  glEnable( GL_DEPTH_TEST )

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:


does it result in equivalent:
gluLookAt(…, n*zed, …) ?

after all it’s just a set of repeated transformations.

Thanks .

multiple gluLookat transformations would be cumulative but exactly how is a more complex issue, basically n*zed for a simple translate, but since you call glLoadIdentity then call gluLookAt there is no cumulative effect.

It’s not clear what is happening in your transform() function, perhaps some shenanigans…

You say you rotate using the mouse but it appears that the only variable there is ‘zed’ which implies you are translating.

Of course not knowing what’s happening in transform() it’s difficult to be sure but you may be lying about that glLoadIdentity() call. If you’re not calling glLoadIdentity and have been told to then you’re wasting our time with a foolishly misleading question :frowning:

I’m not “lying” about anything and have no intent to “waste our time with foolishly misleading questions”.
Let’s just end this discussion here.
Thank you.