how can Irotate a specific area in opengl? glLoadMatrix


I’m beggining to learn opengl and i have drawn a polygon consisting in several polygons, and now I want to know how can I rotate a single area in my polygon. I think I have to use glPushMatrix(), then glLoadMatrix and in this matrix i need to have the points that I want rotated. I have the points in world coordinates but don’t know what to put in the glLoadMatrix. or even if this is the way to do it. please help :slight_smile:

thank you

Generally, the simplest way to do a rotation is to use glPushMatrix(), perform some transformations, draw, glPopMatrix(). This ensure that only the the items drawn in-between the push/pop will be affected by the transformations. For more complex animation, you can nest glPushMatrix()/glPopMatrix() calls to apply transformation in a hierarchy for things like joints in a skeleton.

Take a look at glRotate. I think it does what you want.