PDA

View Full Version : Rotation



SteeleR
11-17-2006, 10:47 AM
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...

lerwen
11-17-2006, 02:25 PM
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.

SteeleR
11-17-2006, 10:48 PM
10x.. it's working :)