{1.0,1.0,0.0},
{1.0,0.0,1.0},
{0.0,1.0,1.0}
};
GLvoid CALLBACK none(void)
{
}
GLvoid CALLBACK draw(void)
{
int i,j;
static int r=0;
glClearColor(0.0,0.0,0.0,0.0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);/*thôn
g sô mới*/
glLoadIdentity();
gluLookAt(3.0,4.0,5.0,0.0,0.0,0.0,0.0,1.0,0.0);
glRotated((double)r,0.0,1.0,0.0);
glEnable(GL_DEPTH_TEST); /*hàm mới*/
glBegin(GL_QUADS);
for(i=0;i<6;i++){
glColor3dv(color[i]);
for(j=0;j<4;j++){
glVertex3dv(vertex[face[i][j]]);
}
}
glEnd();
glDisable(GL_DEPTH_TEST); /*hàm mới*/
auxSwapBuffers();
if(++r>=360) r=0;
}