Rotating Double Doors

Started by
0 comments, last by saisoft 22 years, 9 months ago
Hello, I am fairly new to openGL. I have 5 quads arranged in a specific order to look like a front of a building with double doors. I want to rotate the doors 90 degrees out so it looks like they are opening and closing. I have tried: glRotate(angle,0.0f,1.0f,0.0f) for each door, but it does not look like they are rotating from the hinges of the door, how would I rotate from the hinges of the door. thanks
Advertisement
Hi

glPushMatrix();
glTranslate (to the point of the hinge)
glRotate (fAngle_Y, 0.0f, 1.0f, 0.0f);

glBegin(GL_TRIANGLES);

Draw the door (you might try drawing the door from the hinge out by that I mean hinge x = 0, lock x = max)


glEnd();
glPopMatrix();

3DG

P.S. sorry if this is wrong I am currently a bit busy, it looks correct though.

This topic is closed to new replies.

Advertisement