【发布时间】:2014-11-15 13:26:27
【问题描述】:
到目前为止我的代码
void display ( void )
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer
glLoadIdentity();
gluLookAt( camera[0][0], camera[0][1], camera[0][2],
camera[1][0], camera[1][1], camera[1][2],
camera[2][0], camera[2][1], camera[2][2] ); //Set the point looking at
glRotatef(cubeRot[0], 1.0f, 0.0f, 0.0f); //rotate on x axis
glRotatef(cubeRot[1], 0.0f, 1.0f, 0.0f); //rotate on y axis
glRotatef(cubeRot[2], 0.0f, 0.0f, 1.0f); //rotate on z axis
switch ( Rendermode ) { //different render mode
case 'f':
//Draw object I want to rotate
break;
case 'v':
//Draw object I want to rotate
break;
case 'e':
//Draw object I want to rotate
break;
glLoadIdentity();
}
//Draw object I DO NOT want to rotate
glutSwapBuffers ( ); // Swap The Buffers To Not Be Left With A Clear Screen
}
但是,目前我的所有对象都同时旋转,我怎样才能旋转我注意到要旋转的对象,而让我注意到不想旋转的对象保持静止?
【问题讨论】: