ON);glTranslatef(0,0,0);glRotatef(angle,0,0,1);glVertex2f(100.0f+width,100.0f+highth);//用来画点glVertex2f(100.0f+width,300.0f+highth);glVertex2f(300.0f+width,300.0f+highth);glVertex2f(300.0f+width,100.0f+highth);glEnd();glFlush();}voidmySpecialKeyboard(intkey,intx,inty){if(key==GLUT_KEY_RIGHT)width+=5;if(key==GLUT_KEY_LEFT)width-=5;if(key==GLUT_KEY_UP)highth+=5;if(key==GLUT_KEY_DOWN)highth-=5;glutPostRedisplay();}voidmyKeyboard(unsignedcharkey,intx,inty){if(key=='c'||key=='C')exit(0);glutPostRedisplay();}voidmymouse(intbutton,intstate,intx,inty)//鼠标控制缩放{if(state==GLUT_DOWN){if(button==GLUT_LEFT_BUTTON){ glScalef(0.5,0.5,0.0); display();?}elseif(button==GLUT_RIGHT_BUTTON){glScalef(1.5,1.5,0.0); display();}glutPostRedisplay();//重新调用绘制函数}return;}voidmain(intargc,char**argv){glutInit(&argc,argv);