我之前用代码发布,而不是我要写下psuedocode来简化事情,请告诉我为什么它不正确,因为它不起作用。请注意,我只是旋转其中一个轮辋。
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