rotation

Hey people I’m having trouble, I was wondering is there a way to rotate an objects to a 90 degree with respects to the z-axis without rotating the x and y axis along with it. What I’m trying to do is rotate a block in my attempt to create tetris. so I’m rotating a block. Or do I just need to replot the block

A rotation by 90 is done as follows:

glRotatef ( 90.0f, 0.0f, 0.0f, 1.0f );

Your code should look something like this:

glPushMatrix();
glTranslatef(…); location of piece.
glRotatef(90,0,0,1); Rotate Z-axis

draw_piece();

glPopMatrix();

Originally posted by zeroKelvin:
Hey people I’m having trouble, I was wondering is there a way to rotate an objects to a 90 degree with respects to the z-axis without rotating the x and y axis along with it. What I’m trying to do is rotate a block in my attempt to create tetris. so I’m rotating a block. Or do I just need to replot the block