Rotation

Let’s say i got a rect located at [x,y]… with sides: w and h… and drawn as follows:

glTranslated(x,y,0);
DrawRect(w,h);

How to rotate the rect around it center… I’ve tried a few ways and read several tutorials… but I didn’t found a way to do it… Can anyone help… 10x beforehand…

after you do translate(x,y,0)

translate to the right w/2 and up h/2, do the rotate, and translate it left w/2 and down h/2.

10x… it’s working :slight_smile: