CSE 457: Introduction to Computer Graphics
OpenGL Example Programs
The following is a list of the example programs found in the
OpenGL Programming Guide (Addison-Wesley Publishing Company).
The examples will probably not run unless you are running Netscape locally on
a Silicon Graphics workstation.
- Accumulation buffer anti-aliasing, example 10-4.
Run accanti.
View accanti.c.
- Same scene as accanti without anti-aliasing.
Run accnot.
View accnot.c.
- Same as accanti, but anti-aliasing with perspective, example 10-2.
Run accpersp.
View accpersp.c.
- Yet another accumulation buffer anti-aliasing example.
Run accum.
View accum.c.
- Calculates the field of view in the y direction.
Run aim.
View aim.c.
- Simple 2D alpha blending, example 7-1.
Run alpha.
View alpha.c.
- Alpha blending in 3D, example 7-2.
Run alpha3D.
View alpha3D.c.
- Anti-aliased true color (RGBA) lines, example 7-3.
Run anti.
View anti.c.
- Anti-aliased color index lines, example 7-4.
Run antiindex.
View antiindex.c.
- Anti-aliased points in color index mode.
Run antipindex.
View antipindex.c.
- Anti-aliased points in RGBA mode.
Run antipoint.
View antipoint.c.
- Anti-aliased polygons (Reality Engines only), example 7-5.
Run antipoly.
View antipoly.c.
- Simple 2D bezier curve, example 11-1.
Run bezcurve.
View bezcurve.c.
- Bezier surface, example 11-3.
Run bezmesh.
View bezmesh.c.
- Wire-frame version of bezmesh, example 11-2.
Run bezsurf.
View bezsurf.c.
- Texture maps a checkerboard onto two rectangles, example 9-1.
Run checker.
View checker.c.
- Texture maps a repeated checkerboard onto two rectanges.
Run checker2.
View checker2.c.
- Same as checker2, but only repeats edge pixels, not whole pattern.
Run chess.
View chess.c.
- Arbitrary clipping planes, example 3-5.
Run clip.
View clip.c.
- Diffuse material example.
Run colormat.
View colormat.c.
- A cone.
Run cone.
View cone.c.
- A stretched wireframe cube with perspective.
Run cube.
View cube.c.
- One-dimensional NURBS curve.
Run curve.
View curve.c.
- Fog used to make distant lines darker.
Run depthcue.
View depthcue.c.
- Quadrics used to draw some disks.
Run disk.
View disk.c.
- Accumulation buffer used to make distant objects blurry, example 10-5.
Run dof.
View dof.c.
- Same scene as dof, but without blur.
Run dofnot.
View dofnot.c.
- Double buffering of rotating square, example 1-3.
Run double.
View double.c.
- Draw bitmaps of "F" using glBitmap(), example 8-1.
Run drawf.
View drawf.c.
- Feedback buffer queues GL primatives and then prints them to stdout, example 12-7.
Run feedback.
View feedback.c.
- Teapots in the fog, example 7-6.
Run fog.
View fog.c.
- Fog in color index mode, example 7-7.
Run fogindex.
View fogindex.c.
- Draws text in a bitmapped font using glBitmap() and display lists, example 8-2.
Run font.
View font.c.
- Demonstrates lighting model.
Run light.
View light.c.
- Display lists are used to draw lines with different stipples.
Run linelist.
View linelist.c.
- Diffent types of stippled lines, example 2-1.
Run lines.
View lines.c.
- Executes a display list to draw triangles, example 4-2.
Run list.
View list.c.
- Demonstrates glGenList() and glPushAttrib().
Run list2.
View list2.c.
- Lighting in color map mode.
Run maplight.
View maplight.c.
- Assortment of different materials shown, example 6-3.
Run material.
View material.c.
- Mipmaps used to draw a texture map with a different color for each bitmap size, example 9-2.
Run mipmap.
View mipmap.c.
- Demonstrates modeling transformations, example 3-2.
Run model.
View model.c.
- Light source moves around an object, example 6-2.
Run movelight.
View movelight.c.
- NURBS (Non-uniform rational B-splines) surface shaped like a heart.
Run nurbs.
View nurbs.c.
- Mouse and depth buffer are used to select objects, example 12-6.
Run pickdepth.
View pickdepth.c.
- Mouse is used to select lines.
Run pickline.
View pickline.c.
- Mouse is used to select a square.
Run picksquare.
View picksquare.c.
- Demonstrates directional versus point lights.
Run plane.
View plane.c.
- Composite modeling transformations used in drawing models (arrow keys move spheres).
Run planet.
View planet.c.
- Like planet, but scene is oriented "up."
Run planetup.
View planetup.c.
- Demonstrates polygon stippling, example 2-2.
Run polys.
View polys.c.
- Arrow keys move a wire-frame "arm," example 3-7.
Run robot.
View robot.c.
- Color light source.
Run sccolorlight.
View sccolorlight.c.
- Same scene as sccolorlight, but without colored light.
Run scene.
View scene.c.
- Same scene as sccolorlight, but with blue ambient light.
Run scenebamb.
View scenebamb.c.
- Same scene as sccolorlight, but with flat shading.
Run sceneflat.
View sceneflat.c.
- Shows selection mode and name stack to detect wheter objects collide with viewing volume, example 12-2.
Run select.
View select.c.
- White rectangle on a black background, example 1-2.
Run simple.
View simple.c.
- Gouraud shaded triangle, example 5-1.
Run smooth.
View smooth.c.
- Wire frame sphere using glTranslatef().
Run sphere.
View sphere.c.
- Diamond stencil cuts out part of a scene, example 10-1.
Run stencil.
View stencil.c.
- Demonstrates a stroke (vector) font and display lists,
example 4-8.
Run stroke.
View stroke.c.
- Nurbs surface as a symmetrical hill, example 11-5.
Run surface.
View surface.c.
- One versus two sided lighting.
Run tea.
View tea.c.
- Teapots with different ambient values.
Run teaambient.
View teaambient.c.
- Several different materials shown on teapots
Run teapots.
View teapots.c.
- Texture mapped teapot with texture coordinates generated automatically, example 9-3.
Run texgen.
View texgen.c.
- Evaluators used to generate curved surface and texture corrdinates, example 11-4.
Run texturesurf.
View texturesurf.c.
- BROKEN! Curves trim away part of a NURBS surface, example 11-6.
Run trim.
View trim.c.
- Like font, but draws X fonts.
Run xfont.
View xfont.c.