This directory provides a host of GLUT-based example programs ported from the OpenGL Programming Guide book.
NOTE: ../../lib/glut/libglut.a is employed to generate the binaries in this directory. Hence, if you wish to copy over any specific program for the purposes of experiementation and recompilation, you'll need to either
The following programs are available from this redbook directory:
accanti: accumulation buffer and antialiasing (accanti.c, jitter.h) anti: antialiased lines in RGBA mode (anti.c) bezmesh: renders a lighted, filled Bezier surface, using two-dimensional evaluators. (bezmesh.c) checker: texture maps a checkerboard image onto two rectangles; clamps the texture, if texture coordinates fall outside 0.0 and 1.0. (checker.c) depthcue: wireframe model uses intensity (brightness) to give clues to distance. Fog is used to achieve this effect. (depthcue.c) dof: demos accumulation buffer creating an out-of-focus depth-of-field effect. The teapots are drawn several times into the accumulation buffer. The viewing volume is jittered, except at the focal point, where the viewing volume is at the same position, each time. In this case, the gold teapot remains in focus. (dof.c, jitter.h) fog: draws 5 red teapots, each at a different z distance from the eye, in different types of fog. LEFTMOUSE chooses between 3 types of fog: exponential, exponential squared, and linear. In this program, there is a fixed density value, as well as fixed start and end values for the linear fog. (fog.c) fogindex: demonstrates fog in color index mode. Three cones are drawn at different z values in a linear fog. 32 contiguous colors (from 16 to 47) are loaded with a color ramp. (fogindex.c) material: demos the GL lighting model. Several objects are drawn using different material characteristics. A single light source illuminates the objects. (material.c) mipmap: demos using mipmaps for texture maps. To overtly show the effect of mipmaps, each mipmap reduction level has a solidly colored, contrasting texture image. Thus, the quadrilateral which is drawn is drawn with several different colors. (mipmap.c) nurbs: demos a NURBS (Non-uniform rational B-splines) surface, shaped like a heart. (nurbs.c) pickdepth: demos picking. In rendering mode, three overlapping rectangles are drawn. LEFTMOUSE enters selection mode with the picking matrix. Rectangles which are drawn under the cursor position are "picked." Pay special attention to the depth value range, which is returned. (pickdepth.c) plane: demos use of local versus infinite lighting on a flat plane. (plane.c) polys: demos polygon stippling. (polys.c) sccolorlight: demos use of a colored (magenta, in this example) light source. Objects are drawn using a grey material characteristic. A single light source illuminates the objects. (sccolorlight.c) scene: demonstrates the use of the GL lighting model. Objects are drawn using a grey material characteristic. A single light source illuminates the objects. (scene.c) scenebamb: demos use of a blue ambient light source. (scenebamb.c) sceneflat: draws lighted objects with flat shading. (sceneflat.c) stencil: draws two rotated tori in a window. A diamond in the center of the window masks out part of the scene. Within this mask, a different model (a sphere) is drawn in a different color. (stencil.c) stroke: demos some characters of a stroke (vector) font. The characters are represented by display lists, which are given numbers which correspond to the ASCII values of the characters. Use of glCallLists() is demonstrated. (stroke.c) surface: draws a NURBS surface in the shape of a symmetrical hill. (surface.c) teaambient: renders three lighted, shaded teapots, with different ambient values. (teaambient.c) teapots: demonstrates lots of material properties. A single light source illuminates the objects. (teapots.c) texturesurf: uses evaluators to generate a curved surface and automatically generated texture coordinates. (texturesurf.c)Reference