Just wondering how you make it so a 2d shape can be rotated around the center of the shape.
if the shape is in x-y-plane and the center is at (cx, cy, 0):
glTranslatef(cx, cy, 0);
glRotatef(angle, 0., 0., 1.);
glTranslatef(-cx, -cy, 0);
hrmm this makes my shapes dissapear off the screen, because the shape’s vertices are like:
0,0 ----------w, 0
| |
| |
| |
| |
0,-h----------w, -h
i think it is now time to post some code…
it’s ok I’ve sorted it now. thanks for your help!!