Let's say we have a square, and after it is translated to some location, I want to rotate it around a point within the object.
glPushMatrix();
glTranslatef(50, 50, 0.0);
glRotatef(joint, 0.0, 0.0, 1.0);
glScalef(10,20, 1.0);
glTranslatef(0.0, -0.5, 0.0);
glColor3f(1.0, 0.0, 0.0);
drawSquare(1.0);
glPopMatrix();
The one above only rotates around the (0.0) point after it's scaled. If I change the glRotatef(joint, 0.0, 0.0, 1.0) to glRotatef(joint, 0.0, 5.0, 1.0), then the object starts getting twisted.