GLUT 3.1 dist example src programs
This directory provides 39 example programs
leveraging off GLUT functionality.
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
- download this entire directory, plus,
../../GL/glut.h, as well as
../../lib/glut/libglut.a.tar.Z,
or,
- get everything by simply grabbing the entire
../../glut-3.1.tar.Z (1,158,329 bytes)
3.1 version of the GLUT distribution, to get everything
that way.
The following programs are available from this examples directory:
- abgr: Demonstrates the use of the extension EXT_abgr
The same image data is used for both ABGR and RGBA formats
in glDrawPixels and glTexImage2D. The left side uses ABGR,
the right side RGBA. The top polygon demonstrates use of texture,
and the bottom image is drawn with glDrawPixels.
Note: the textures are defined as 3 component, so the
alpha value is not used in applying the DECAL environment.
- abgr.c
- bitfont: Renders sample text using builtin GLUT bitmap fonts.
- blender: renders two spinning icosahedrons (red and green).
The blending factors for the two icosahedrons vary
sinusoidally and slightly out of phase. blender also
renders two lines of text in a stroke font: one line
antialiased, the other not.
- blender.c
- dials: GLUT-version of dials+buttons box confidence test
- dials2: GLUT-version of dials+buttons box confidence test, take 2
- dinoball: dinosaur with 2 lights
lights are to the right and left of the model, and can be toggled
on/off via RIGHTMOUSE menu
- dinoball.c
- dinospin: mouse-move-able dinosaur
Dinosaur model can be spun at any orientation around the Y axis with the
mouse. New GLUT 3.1 glutGetModifiers() functionality used to make
Shift-Left mouse scale the dinosaur's size.
- dinospin.c
- trackball.c
- trackball.h
- evaltest: GLUT version of evaluator test
- fogtst: bare-bones GLUT fog frame test
- fontdemo: demos GLUT bitmaps and stroke with 3D perspective fonts
- puzzle: GLUT-based version of src/demos/OpenGL/puzzle when it used libaux
the src/demos/OpenGL version currently uses GLUT now, but it used
to employ libaux. oh well, a replica program in the toolbox src tree......
- glpuzzle.c
- trackball.c
- trackball.h
- glutdino: Port of src/exampleCode/opengl/x+opengl/glxdino to GLUT
renders simplistic dinosaur model with lighting
- glutdino.c
- Port of src/exampleCode/opengl/x+opengl/paperplane to GLUT
- highlight: demonstrates use of the GL lighting model.
Objects are drawn using a grey material
characteristic. A single light source illuminates the objects.
- highlight.c
- lightlab: explores OpenGL's lighting model
- mjkwarp: demos texture mapping
using the face of yours truly.
- mjkwarp.c
- mjkimage.c.Z -- this file defines the
unsigned char mjk_image[] 256x256x3 array and is compressed (see Makefile for how this compressed file is folded
into the compile) because of it's 13244 lines/747174 characters in
size.
- molehill: nurbs, lighting, materials, smooth-shading 4-color "molehill"
patch
- movelight: lighting and modeling transformation study.
movelight demonstrates when to issue lighting and transformation
commands to render a model with a light which is moved
by a modeling transformation (rotate or translate).
The light position is reset after the modeling
transformation is called. The eye position does not
change.
A sphere is drawn using a grey material characteristic.
A single light source illuminates the object.
pressing LEFT or MIDDLE -MOUSE alters the modeling
transformation (x rotation) by 30 degrees. The scene
is then redrawn with the light in a new position.
- movelight.c
- oclip: demos arbitrary clipping functionality
the rendering is
kept simple (wireframe) and only one clipping plane is
used. GLUT version of src/exampleCode/opengl/motif/oclip.c
- oclip.c
- ohidden: demos stencil plane functionality, rendering is wireframe.
- olight: implements hardware lighting including two_sided lighting.
- olympic: Animated 3D rings spin to form the olypmic logo
- oversphere: overlay sphere positioning demo
- origami: watch a paper plane fold and unfold in real-time
Uses the EXT_polygon_offset extension if available to better
render the fold outlines.
- origami.c
- scene: demonstrates use of the GL lighting model
Objects are drawn using a grey material
characteristic. A single light source illuminates the objects.
- scene.c
- scube: draw a lit spining cube and its shadow
- sphere: red and gray sphere in two different windows
demonstrating a lot of GLUT functionality
"Don't take this program too seriously. It is just a hack."
- sphere.c
- sphere2: Two spheres
- splatlogo: splat the mason-woo-commemorative OpenGL lettering logo
LEFTMOUSE gets it there, RIGHTMOUSE has menu-full-o-options
- splatlogo.c
- spots: implementation of spotlights "swinging about"
- stars: galaxy cruzing thru dr. cement's red-dwarf-infested space
- stenciltst: performs single-frame blue-square green-intersecting
red-triangle
- stereo: stereo example using GLUT
- stroke: uses GLUT built-in stroke fonts to achieve anti-aliased
font rendering
- subwin: implements GLUT sub-windows
- surfgrid: simple test of polygon offset
options:
-f run on full screen
keys:
p toggle polygon offset
F increase polygon offset factor
f decrease polygon offset factor
B increase polygon offset bias
b decrease polygon offset bias
g toggle grid drawing
s toggle smooth/flat shading
n toggle whether to use GL evaluators or GLU nurbs
u decr number of segments in U direction
U incr number of segments in U direction
v decr number of segments in V direction
V incr number of segments in V direction
escape quit
- texenv: texture environment
Demonstrates texture environment modes and internal image formats.
Requires the GL_EXT_texture extension.
- texenv.c
- triselect: select test with triangles
keys:
Z Zoom out
z zoom in polygon offset factor
f perform feedback
l toggle triangles between fill and outline
LEFTARROW rotate counter-clockwise
RIGHTARROW rotate clockwise
LEFTMOUSE cycle colors if on top of triangle
MIDDLEMOUSE move triangle mouse pointer is on towards eye
RIGHTMOUSE disappear triangle mouse pointer is on
- zoomdino: overlay implementation
zoomdino demonstrates GLUT 3.1's new overlay support. Both
rubber-banding the display of a help message use the overlays.
- zoomdino.c
Files of interest from "src/exampleCode/opengl/GLUT/progs/examples" directory
Reference
OR, ...
Copyright © 1995-96, Silicon Graphics, Inc.