Changing the view

Alright quick question. I have a object orbiting the orgin how would I follow the object with the viewport?, I believe this would acheiving an effect that creates the illusion that the object is not moving at all. I believe you use gluLookat but I am not sure

Yes you would use gluLookAt();


gluLookAt(cam.x, cam.y, cam.z, obj.x, obj.y, obj.z, up.x, up.y, up.z);

where cam is the camera position
obj is the object position
and up defines which way is up