home *** CD-ROM | disk | FTP | other *** search
- /*
- * DrawScene uses OpenGL commands to draw a object.
- *
- * Input parameters:
- * hdc = Device context handle
- * nAngle = Angle of rotation for object
- *
- * Returns:
- * Nothing
- */
-
- void DrawScene (HDC hdc, UINT nAngle,UINT nAngle2)
- {
- sizex=glnWidth;
- sizey=glnHeight;
-
- gldAspect = (GLdouble) glnWidth / (GLdouble) glnHeight;
-
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
- gluPerspective (30.0, // Field-of-view angle
- gldAspect, // Aspect ratio of viewing volume
- 1.0, // Distance to near clipping plane
- 10.0); // Distance to far clipping plane
-
- glViewport (0, 0, glnWidth, glnHeight);
- //
- // Clear the color and depth buffers.
- //
- glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- //
- // Define the modelview transformation.
- //
- glMatrixMode (GL_MODELVIEW);
- glLoadIdentity ();
- glTranslatef (0.0f, 0.0f, -8.0f);
- glRotatef (30.0f, 1.0f, 0.0f, 0.0f);
- glRotatef ((GLfloat) nAngle, 0.0f, 1.0f, 0.0f);
- glRotatef ((GLfloat) nAngle2, 1.0f, 0.0f, 0.0f);
- glScalef (nSize+2.5f,nSize+2.5f,nSize+2.5f);
-
-