Ahoj, mam problem s glRotatef funkciou, vid prilozeny obrazok. Kod:
struct rect{
int x;
int y;
int width;
int height;
int angle;
color4f color;
int speedX;
int speedY;
};
void se_drawRect(rect rect){
glTranslatef(rect.x, rect.y, 0);
glRotatef(rect.angle, rect.width/2, rect.height/2, 0);
glColor4f(rect.color.r, rect.color.g, rect.color.b, rect.color.a);
glBegin(GL_QUADS);
glVertex3f(0,0,0);
glVertex3f(rect.width,0,0);
glVertex3f(rect.width,rect.height,0);
glVertex3f(0,rect.height,0);
glEnd();
glLoadIdentity();
}
int main(){
...
rect rect1= {50,50,200,100,10, se_mapRGBA(1,1,1,1)};
...
while(true){
...
se_drawRect(rect1);
...