   OpenGL rotate quad around centre
  Hi,I have a ortho matrix setup for the projection matrix, with the following valuesglOrtho(-100, 100, -100, 100, -1, 1);Essentially I have a quad which is being rendered which has the coordinates set to the lower left hand corner. As so:const GLfloat coords[] = {0.0f, 0.0f, // top left0.0f + size.x, 0.0f, // top right0.0f + size.x, 0.0f + size.y, // bottom right0.0f, 0.0f + size.y // bottom left};glPushMatrix();glLoadIdentity(); // set the current colour (white R=G=B=1)glColor3f(color.x, color.y , color.z);glTranslatef(location.x, location.y, 0.0f);glRotatef(rotationDegreesAngle, 0.0f, 0.0f, 1.0f);glVertexPointer(2, GL_FLOAT, 0, coords);glEnableClientState(GL_VERTEX_ARRAY);glDrawArrays(GL_QUADS, 0, 4);glPopMatrix();The issue I am having is the glRotatef works correctly, however, it pivots the quad on the corner, not in the centre.How would I change glRotate to pivot around the centre of the object.Thanks in advance.   
  Rotations are always around the origin. So to rotate around another point, you need to translate the object to the origin, rotate, and then reverse the translation.glTranslate(x, y, z);glRotate(...);glTranslate(-x, -y, -z);The origin of rotation will be (x,y,z).Or, you can specify the object around it's center to begin with. That is, specify the quad as extending from -size/2 to size/2, instead of from 0 to size.   ;Quote:Original post by Brother BobRotations are always around the origin. So to rotate around another point, you need to translate the object to the origin, rotate, and then reverse the translation.glTranslate(x, y, z);glRotate(...);glTranslate(-x, -y, -z);The origin of rotation will be (x,y,z).Or, you can specify the object around it's center to begin with. That is, specify the quad as extending from -size/2 to size/2, instead of from 0 to size.Hi Brother Bob.Changing the quad to -size/2 and size/2 was the best solution for me.Thanks.   