SGI Windows NT Toolbox
|Download Files|

Balls Of Wonder

Balls Of Wonder was written to test out the OpenGL and GLU libraries.

It demonstrates the old desktop game with the swinging balls. You can interact with it by moving the balls around and then letting them go. A number of options exist for turning on textures, shadows and/or changing the way the balls are displayed. There is a mirror in the background that reflects what you see. The physics aren't perfect, but it's a decent simulation.

The program has code for loading bitmap files as textures and makes use of the Stencil buffer to help with shadow display. Shadows are displayed by creating a matrix that collapses all points to a plane and then using this matrix when redrawing the scene. The code is reasonably well documented. Have fun with it.

Peter Shafton (jibe@sgi.com)

OPTIONS
-------
reality    - Sets it so the balls don't come to a complete stop at
             the bottom of their swing.
motion     - Starts the balls moving if any would be in real life.
rotate     - Rotates the stand around in a circle (makes the shadows
             more interesting).
texture    - Adds textures to the scene to add realistic colors.
             The balls themselves are environment mapped using the
             infamous office scene.
shadows    - Displays shadows cast from a single light source. No
             self-shadowing here.
             The stencil buffer is implemented so this should work
             on a machine without texturing hardware.
mirroring  - Shows a mirror'd version of the toy in the background

POSITION   - These move the balls to a preset number of positions
             that most people are used to.
--------
FILL       - Shows the program using shaded polygons.
LINE       - Shows the program using only lines.
SILHOUETTE - Shows the program using polygon silhouettes.
POINT      - Shows the program using only points.

NONE       - No shading effects from the light.
FLAT       - Shading is done on a per face basis.
SMOOTH     - Shading is done on a per vertex basis.

Note: the arrow keys can be used to move the scene around.
      The program needs the texture files to make the it interesting.


Web Accessible Files of the src/gfx/opengl/exampleCode/BallsOfWonder directory:

This is an automatically derived categorization of files of this directory. Only files which can be displayed or heard in some manner are included. Files may be immediately accessed by clicking the corresponding link. The Zip Archive contains all files in this directory/subtree (including executables, subdirectories, etc.)

Source

Documentation

Reference

Zip Archive


Copyright © 1999, Silicon Graphics, Inc.