OpenGL Super Bible! Page 383 display list for (Post office web site)
OpenGL Super Bible! Page 383 display list for each part of the bolt, and then one display list that does all the coordinate transformations and calls the lists to create the completed bolt. Listing 10-10 New spinning bolt code using display lists #define HEAD_LIST #define SHAFT_LIST #define THREAD_LIST #define BOLT_LIST 1 2 3 4 // This function does any needed initialization on the rendering // context. Here it sets up and initializes the lighting for // the scene, and creates display lists used later void SetupRC() { // Create display list for Bolt head glNewList(HEAD_LIST,GL_COMPILE); RenderHead(); glEndList(); // Create display list for shaft glNewList(SHAFT_LIST,GL_COMPILE); RenderShaft(); glEndList(); // Create display list for thread glNewList(THREAD_LIST,GL_COMPILE); RenderThread(); glEndList(); // Create nested display list for entire bolt glNewList(BOLT_LIST,GL_COMPILE); // Clear the window with current clearing color glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Make sure we have the correct matrix mode glMatrixMode(GL_MODELVIEW); // Rotate and translate the coordinate system // Note this will be cumulative glRotatef(5.0f, 0.0f, 1.0f, 0.0f); // Translate and render the head glTranslatef(0.0f, 0.0f, 55.0f); glCallList(HEAD_LIST); // Translate back some and render the shaft and thread together glTranslatef(0.0f, 0.0f, -15.0f);
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.