PDA

View Full Version : Changing the view



Sappling
06-06-2006, 07:33 PM
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

06-07-2006, 12:13 AM
Yes you would use gluLookAt();

example:

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