glVertex3dv(vertex[face[i][j]]);
}
}
glEnd();
}
GLvoid CALLBACK none(void)
{
}
GLvoid CALLBACK draw(void)
{
static int r=0;
static GLfloat red[]={ 1.0,0.0,0.0,1.0};
static GLfloat blue[]={ 0.0,0.0,1.0,1.0};
glClearColor(0.0,0.0,0.0,0.0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glPushMatrix();
glRotated((double)r,0.0,1.0,0.0);
glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,red);
cube();
glPushMatrix();
glTranslated(1.0,1.0,1.0);
glRotated((double)(2*r),0.0,1.0,0.0);
glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,blue);
cube();
glPopMatrix();
glPopMatrix();
glDisable(GL_LIGHT0);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);