PDA

View Full Version : Simple rotate issue



CoolBeanJ
05-07-2011, 02:48 AM
Hi guys, I dont know how to do something pretty simple, basically i want to rotate my scene around an object while keeping the object centered in the screen.

I.E

Pick an object -(done)
When rotating rotate around the object
Also keep the object in the center of the screen.

The way i'm doing it is

gltranslate to the point of the object
glrotate
gltranslate back

This gives me the rotation around the point but I have no idea how to make it so that the center of the screen is where the object is and still have the sceen rotated though.

Thanks.

dorbie
05-07-2011, 10:21 PM
Use glulookat to position the camera looking at the object before all of the above.

CoolBeanJ
05-07-2011, 11:40 PM
Cheers works perfect!