PausinginOpenGLsuccessivelyvoidkeyPress(unsignedcharkey,intx,inty){ inti; switch(key){ case'f': i=3; while(i--){ x_pos+=3; sleep(100); glutPostRedisplay(); } }}以上是在Windows7中使用GLUT库用C语言编写的代码片段。此函数采用字符键和鼠标坐标x,y并在按f字符时分3个连续步骤沿x方向执行平移。在每一步之间,程序应该hibernate100毫秒。我们要移动一个机器人,并在他前