void snowman() //отрисовка снеговика { glPushMatrix(); double c = 0.9; glColor4d(0.75, 0.75, 0.75, c); glTranslated(0, -3, 0); auxSolidSphere(2.0); glTranslated(0, 3, 0); auxSolidSphere(1.5); glColor4d(0.75, 0.75, 0.75, c); glTranslated(0, 2, 0); auxSolidSphere(1); glColor4d(0, 0, 0, c); glTranslated(-0.3, 0.3, 1); auxSolidSphere(0.1); glTranslated(0.6, 0, 0); auxSolidSphere(0.1); glTranslated(-0.3, -0.3, 0); glColor4d(1, 0, 0, c); auxSolidCone(0.3, 0.5); glTranslated(0, 0.75, -1); glColor4d(0, 0, 1, c); auxSolidCylinder(0.75, 2.); glPopMatrix(); }
void display(void) { GLfloat position[] = { 0.0, 0.0, 1.0, 1.0 }; GLfloat mat_torus[] = { 0.75, 0.75, 0.0, 1.0 }; GLfloat mat_cylinder[] = { 0.0, 0.75, 0.75, 0.15 }; glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLightfv (GL_LIGHT0, GL_POSITION, position); glPushMatrix (); if (eyePosition) gluLookAt (0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); else gluLookAt (0.0, 0.0, -9.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); glPushMatrix (); glTranslatef (0.0, 0.0, 1.0); glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_torus); auxSolidTorus (0.275, 0.85); glPopMatrix (); glEnable (GL_BLEND); glDepthMask (GL_FALSE); glBlendFunc (GL_SRC_ALPHA, GL_ONE); glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_cylinder); glTranslatef (0.0, 0.0, -1.0); auxSolidCylinder (1.0, 2.0); glDepthMask (GL_TRUE); glDisable (GL_BLEND); glPopMatrix (); glFlush (); }
CEE3DINPROC_API void _stdcall CeE3DSolidCylinder(GLdouble a, GLdouble b) { auxSolidCylinder(a, b); }