OpenGL Super Bible! Page (How to cite a web site) 477 /* * Setup

OpenGL Super Bible! Page 477 /* * Setup viewing transformations for the current position and * orientation */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0, (float)rect->right / (float)rect->bottom, 0.1, 1000.0); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glRotatef(Roll, 0.0, 0.0, 1.0); glRotatef(Pitch, -1.0, 0.0, 0.0); glRotatef(Heading, 0.0, 1.0, 0.0); glTranslatef(-Position[0], -Position[1], -Position[2]); glScalef(TERRAIN_SCALE, TERRAIN_SCALE, TERRAIN_SCALE); if (!(Moving || Drawing)) { /* * Draw the sky */ glDisable(GL_LIGHTING); glCallList(SkyTexture); glBegin(GL_QUAD_STRIP); for (i = 0; i < 4; i ++) { glTexCoord2f((float)i, 0.0); glVertex3fv(sky_bottom[i]); glTexCoord2f((float)i, 0.8); glVertex3fv(sky_top[i]); }; glTexCoord2f(4.0, 0.0); glVertex3fv(sky_bottom[0]); glTexCoord2f(4.0, 0.8); glVertex3fv(sky_top[0]); glEnd(); glBegin(GL_TRIANGLE_FAN); glTexCoord2f(0.5, 1.0); glVertex3f(0.0, TERRAIN_SIZE, 0.0); for (i = 0; i < 4; i ++) { glTexCoord2f((float)i, 0.8); glVertex3fv(sky_top[i]); };
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Leave a Reply