//创建显示列表******************************************************** void Cab_mfcView::JIQIREN() { //躯干 ::glNewList(1,GL_COMPILE_AND_EXECUTE); glColor3f(.0,0.0,1.0); auxSolidBox(6,8.5,5); ::glEndList(); //胳膊 ::glNewList(2,GL_COMPILE_AND_EXECUTE); glColor3f(0.0,1.0,1.0); auxSolidBox(8,2,1); //auxSolidSphere(1.6); ::glEndList(); //头和脖子 ::glNewList(3,GL_COMPILE_AND_EXECUTE); glColor3f(1.0,1.0,0.0); auxSolidCube((GLdouble) 3); auxSolidBox((GLdouble) 1,(GLdouble) 0,(GLdouble) 1) ;//脖子 ::glEndList(); //腿 ::glNewList(4,GL_COMPILE_AND_EXECUTE); glColor3f(0.0,1.0,.0); auxSolidBox((GLdouble) 2,(GLdouble) 6,(GLdouble) 3) ; ::glEndList(); //眼 ::glNewList(5,GL_COMPILE_AND_EXECUTE); glColor3f(1.0,.0,.0); auxSolidSphere(0.6); ::glEndList(); //嘴 ::glNewList(6,GL_COMPILE_AND_EXECUTE); glColor3f(1.0,0.0,1.0); auxSolidBox(1.5,0.6,0.2); ::glEndList(); }
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////Draw Primitivs////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// void DrawPrimitivs(void) { //Draw triangle! glPushMatrix(); glLoadIdentity(); glRotated(180,0,1,0); glRotated(30,1,0,0); glTranslated(2,1,0); glBegin(GL_TRIANGLES); glColor3d(1,0,0); glVertex3d(0,0,0); glColor3d(0,1,0); glVertex3d(-2,3,0); glColor3d(0,0,1); glVertex3d(2,4,0); glEnd(); glPopMatrix(); //Draw small teapot glPushMatrix(); glLoadIdentity(); glTranslated(3,3,-5); glRotated(time,1.,1.,1.); glColor3d(0,1,0); auxSolidTeapot(1); time++; glPopMatrix(); //Draw small box glPushMatrix(); glLoadIdentity(); glTranslated(3,-3,-5); glRotated(time,1.,1.,1.); glColor3d(0,0,1); auxSolidBox(2,2,2); glPopMatrix(); }
CEE3DINPROC_API void _stdcall CeE3DSolidBox(GLdouble a, GLdouble b, GLdouble c) { auxSolidBox(a, b, c); }