Eight demos use libglut.a from Mark Kilgard's OpenGL Utility Toolkit, (GLUT):
A pre-built libglut.a library is included in the lib directory. This library is built from the source living in ../../exampleCode/opengl/GLUT/lib/glut/, release 3.1 of the OpenGL Utility Toolkit resident on the Toolbox.
Five demos use the OpenGL Motif Widget, libGLw.a:
One demo uses the OpenGL Character Renderer, libGLC.a:
One "hold-out" still uses libtk, a library supplying simple windowing, event handling, and more using only Xlib:
NOTE: The OpenGL people in engineering are attempting to move beyond libtk, and, in the longer run, libaux. Mark Kilgard's libglut is a much more "current generation" toolkit offerring many useful features for those who are not already "X gods".The src for libtk is in insect/libtk/.
ALL use the GL and GLU OpenGL libraries except for space (which only uses GL):
To Run: % atlantis [-dr] [-ir] [-f file.rgb] -dr run in direct render mode (rendering goes directly to the hardware) -ir run in indirect render mode (rendering goes through the X server) -f file.rgb by specifying a .rgb file, atlantis will use the image to simulate the water reflection off the fishes mouse buttons pressed while mouse held stationary: LEFTMOUSE - translate "to the left and up" MIDDLEMOUSE - rotate "to the right and down" RIGHTMOUSE - translate away from the eyepoint r/R KEY - reset view as when window first came up ESC - exit program Demonstrates: Lighting, animation capabilities, texture-mapping.
To Run: % backtrace RIGHTMOUSE - rotates around the z axis MIDDLEMOUSE - changes radius LEFTMOUSE - changes phi (azimuth) ESC - exit program To select a light, click (any MOUSEBUTTON) on it. For a non-interactive demo, select "Rotate Automatically" under the "Motion" menu. Comments: Should run pretty quickly on most systems as long as the texture mapping is turned off.
To Run: % drip [-r[number]] [-f] [-w] every new MOUSEBUTTON press makes another expanding drop LEFTMOUSE - make expanding red drops MIDDLEMOUSE - make expanding green drops RIGHTMOUSE - make expanding blue drops ESC - exit program -r - makes random drops for non-interactive demo. Without the -r option, pressing LEFT/MIDDLE/RIGHT -MOUSE buttons makes drops of color. -f - run in fullscreen mode -w - set the background to WHITE Demonstrates: 2D graphics Blending functions. Comments: Not too involved or flashy, but should run quickly.
To Run: % fadeflip [file1.rgb] [file2.rgb] [file3.rgb] [...] RIGHTMOUSE - spin the object, release while dragging to give momentum. Without filenames, uses defaults. Files must be square. If it complains it can't find the files, you may have to give it full pathnames. Demonstrates: Texture mapping. Comments: Another small and mildly amusing demo
A string and its bounding box is drawn and can be manipulated in the following ways:
To Run: % globe LEFTMOUSE - stops program animation sequence RIGHTMOUSE- pop-up menu does "Step" (one frame-at- a-time) and "Toggle Spinning"
To Run: % glutduck LEFTMOUSE - stops program animation sequence RIGHTMOUSE- pop-up menu does "Step" (one frame-at- a-time) and "Toggle Spinning" SPACEBAR - press-release: single-step press-hold down: continuous animation Comments: Based on an example from The Inventor Mentor, chapter 13, example 5.
To Run: % ideas -a LEFTMOUSE - restarts program animation sequence SPACEBAR - pause/unpause toggle -a run program continuously Comments: Should look good on almost any platform. Demonstrates: Stippling, lighting, animation capabilities.
To Run: % insect LEFTMOUSE - pan left or right depending on "x-location" of cursor (ie, left of window center, pan left) MIDDLEMOUSE - pan up or down depdning upon "y-location". - both of the above move faster the further away the mouse is from the window center. f/F - toggle's movement of the eye ESC - exit program Demonstrates: Lighting, Colormap (includin 8-bit machines), display lists, (hierarchically-defined insect model) animation capabilities.
To Run: % lorenz [-h] [-i] [-x] [-s speed] [-w rot_v] [-g gravity] -h Print this message. -i Print information about the demo. -x Enclose the particles in box made of hexagons -s speed Sets the number of new line segments per redraw interval per line. Default value: 3 -w rot_v Spins the hexagons on their centers, box sides on their centers. Hexagons spin at rate rot_v degrees per redraw, box sides spin at -rot_v/2 degrees per redraw. -g gravity Sets the strength of the attraction of the eye to the red particle. Actually, it's not gravity since the attraction is proportionate to distance. Default value: 0.002. Try large values! Executions control:step through single frames g begin continuous frames s stop continuous frames Comments: shows particles stuck in a Lorenz attractor (parameters used are r=28, b=8/3, sigma=10). The eye is attracted to the red particle, with a force directly proportional to distance. A command line argument puts the particles inside a box made of hexagons, helping to maintain the sense of 3 dimensions, but it can slow things down. Other options allow you to play with the redraw rate and gravity. For general info on Lorenz attractors see "An Introduction to the Lorenz Equations", IEEE Transactions on Circuits and Systems, August '83. BUGS: hidden surface removal doesn't apply to hexagons, and works poorly on lines when they are too close together. NOTES ON OPENGL PORT: The timer functions do not exist in OpenGL, so the drawing occurs in a continuous loop, controlled by step, stop and go input from the keyboard. (Perhaps system function could be called to control timing.)
To Run: % puzzle r Reset puzzle s Solve puzzle (may take a few seconds to compute) d Destroy a piece - makes the puzzle easier b Toggles the depth buffer on and off RIGHTMOUSE spins the puzzle LEFTMOUSE moves pieces ESC exit program
When approaching vicinity of planets or moons actual texture-map surfaces or polygons of the spheres are able to be made visible. This demo will run on all current SGI architectures. On non-realtime texturing architectures, entering into single-buffer mode will enable non-real time options with texturing. questions or comments, please contact Erik Lindholm: erilk@sgi.com or 415/390-1513. MOUSE CONTROLS left : accelerates middle : brakes right : pan/rotate toggle left+right : face nearest moon middle+right : face nearest planet left+middle : face nearest star KEY CONTROLS Esc : quit Shift : defeat mouse controls (for menu) Ctrl : disconnect view vector from velocity vector a : autopilot b : single buffer mode (< 24bits) (trigger: LEFTMOUSE) h : on screen help toggle i : moons/orbits toggle l : reshade polyplanet every frame n : star name toggle o : planets/orbits toggle q : control panel toggle r : decelerates time by 10 s : stellar system statistics t : accelerates time by 10 u : user entry mode (use with system statistics) v : reverse velocity x : text display toggle y : time reset z : display constellation boundaries - : time direction toggle up arrow : increase tesselation level (max: 5) down arrow : decrease tesselation level (min: 0) PrintScrn : snap rgb image and quit TEXT COLOR CODES red : in interplanetary space blue : in interstellar space yellow: in intergalactic space green : currently being eclipsed TOURIST SPOTS Sol: 0 Sirius: 728 Altair(C): 2255
To Run: % stonehenge on Reality Engines, turn on texture mapping under "SPFX" menu. Try Turning on "Scale = 1:500" under the "Time" menu - if it's too jerky turn it off again. May want to set weather. The telescope option under the "SPFX" menu gives a little telescope which can be moved around using the mouse. For a non-interactive demo, select "Demo Mode" under the "Misc" menu. ESC exit program Mouse interface: Make sure Demo Mode is turned off. LEFTMOUSE - turn MIDDLEMOUSE - horizontal motion changed speed: left to right = forward right to left = backward RIGHTMOUSE - stop motion Comments: May have a couple of bugs.
To Run: % tex_cube [name_of_square_rgb_file] Uses a default image if no filename is specified Drag with mouse to rotate every new MOUSEBUTTON press makes another expanding drop ESC - exit program h/H - halt movement/rotation of cube w/W - reset to initial position SPACEBAR - pause rotation movement toggle
To Run: % glutduck LEFTMOUSE - in Main window: stops prog animation Rotation Curves window: move animation thru curve plots RIGHTMOUSE- pop-up menu does Viewing -> Flying Move Polar Move Model-> Wire Cubes Solid Cubes Cylinder 1 Cylinder 2 Toggle Axes Toggle Perspective View Quit SPACEBAR - press-release: single-step press-hold down: continuous animation Comments: Although the model only has a few degrees of freedom, various sequences (running, jumping, dunking...) are implemented.