PDA

View Full Version : Rotating around a point in a model



gerire
11-22-2002, 11:05 AM
I decided to design a 3d model in OpenGL, I finally finished the airplane and want, when a key is pressed, to rotate around a center point in the fuselage, Could someone give me this, I sure simple, answer, cheers G

nexusone
11-22-2002, 12:00 PM
Simple answer, works if origin 0,0,0 is the center of the plane, else you would need to translate the plane before rotating to center.

glPushMatrix()
glTranslate
glRotate

draw_airplane()
glPopMatrix()