Possible Duplicate:
rotating tire rims of car opengl transformations
I posted earlier with code, instead i am going to write down the psuedocode to simplify things, please tell me why it is incorrect since it is not working. Note that i am only rotating the one of the rims.
glMatrixMode(GL_MODELVIEW)
glLoadIdentity( )
*Above is done with initialize function*
press up arrow key
glTranslatef(0,-1,0)
self.fFlag = "true"
Draw car
In Draw car function,
if fflag is true and part is tire rim then
glPushMatrix()
glRotatef(45,1,0,0)
Draw the rim
glPopMatrix()
else: Draw other parts of car