just a quick question on how to rotate my quad exactly the way i want.
some code…
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer
glLoadIdentity (); // Reset The Modelview Matrix
glTranslatef (xpos, ypos, -18.0f); // Translate 6 Units Into The Screen
glRotatef (angle, 0.0, 0.0f, -1.0f); // Rotate On The Y-Axis By angle
glBegin (GL_QUADS); // Begin Drawing Triangles
glColor3f (1.f, 0.f, 0.f); glVertex3f( 0.0f, 1.0f, 1.0f);
glColor3f (0.f, 1.f, 0.f); glVertex3f( 1.0f, 1.0f, 1.0f);
glColor3f (0.f, 0.f, 1.f); glVertex3f( 1.0f, 0.0f, 1.0f);
glColor3f (1.f, 0.f, 1.f); glVertex3f( 0.0f, 0.0f, 1.0f);
glEnd (); // Done Drawing Triangles
Now what i want to be able to do is to rotate my quad from the centre of it. At the moment it is rotating from the 2nd vertex that i draw.
Could someone point me in the right direction please???