REVOLUTION(6D) REVOLUTION(6D)
NAME
revolution - surface of revolution with a binary space
partition tree hidden surface scheme or a cluster tree
hidden surface scheme
SYNOPSIS
/usr/demos/revolution [ filename ]
DESCRIPTION
Revolution allows a user to form an outline and make a sur-
face of revolution. 36 sections of polygons corresponding to
arcs of 10 degrees in rotation of the outline are displayed
as a surface. The surface is drawn in wire frame with depth
cued vectors. Calulations are done on the polygons to
determine colors based on a complex light model and a number
of light sources. The object is then drawn as a gouraud
shaded solid with the tree hidden surface scheme.
This image can also be displayed with hidden surfaces re-
moved using the IRIS zbuffer capabilities or with no hidden
surface removal at all. When using the tree hidden surface
removal scheme, the image can be rendered with gouraud shad-
ing or with flat (one color per polygon) shading. The
gouraud shading uses 128 shade levels of the current color.
(64 shades on the bubble machines.) The color may be change
if desired.
The surface can be rotated around any of the three principal
axes. This can be done with the object in wire frame, flat
shaded, or gouraud shaded.
Starting the Program
The revolution program may be started with a file name as an
argument. The file should contain a previously saved out-
line. Instead of allowing the user to create an outline,
the program will read the outline from the file. Once the
program is started, use the pop-up menu to select some op-
tions. (See "Pop-up Menu Operation" below.) There are three
entries on this menu: Cluster, BSP tree and Read File.
Selecting one of the first two will set the hidden surface
removal to that type (either the cluster tree or the BSP
tree) and then go into a mode to create the surface of revo-
lution. Selecting the last entry will prompt for a file
name to read the outline from. If one of the first two are
selected without having been provided a valid outline file,
the program will let the user create an outline.
Creating a Form
To create the outline that will be used for the surface of
revolution, attach to the window labeled Revolution. Select
the hidden surface removal type from the pop-up menu (Clus-
ter or BSP). A set of axes appears in the window. The sur-
Page 1 (last mod. 8/20/87)
REVOLUTION(6D) REVOLUTION(6D)
face is formed by revolving the outline created around the
vertical axis. To enter the vertices of the outline, move
the cursor to the desired location and press the right mouse
button. Repeat this until the outline is complete. Then
press the middle mouse button to start the form by revolu-
tion calculations. The user can enter a maximum of fifty
vertices at which time the program will automatically start
the form by revolution calculations. The cursor turns into
an hourglass to let the users know they have to wait for the
creation of the cluster or BSP tree. When the tree is fin-
ished, the cursor returns to an arrow and the shape is
displayed gouraud shaded with the tree hidden surface
scheme.
Pop-up Menu Operation
Once the tree is complete, use the right mouse button to
operate a pop-up menu. To choose items off the menu, press
the right mouse button to display the pop-up menu. Move the
cursor until the desired menu option is highlighted and
release the button. To get rid of the menu without changing
the display, move the cursor clear of the menu and release
the button.
-Color has an arrow to the side to indicate that if you go
off to the side of the menu entry, a rollover menu appears.
This menu has a selection of colors that one may choose for
the color of the surface. Except on bubble machines, the
last entry toggles color control between the top and bottom
portions of the object. Objects that have been stored in a
file as two parts will draw in two colors. The user can
change the color of each part separately by toggling the ac-
tive sections from the top to the bottom and back. Select
the Top/Bot entry to do this. Then select a new color.
-Rotate brings up slider bars and puts the manipulation of
the surface under slider control. This allows the user to
rotate the object as a wire frame.
-Translate also brings up slider bars and pust the manipula-
tion of the surface under slider control. This allows the
user to translate the object as a wire frame.
-Zbuffer draws the surface with gouraud shading and the
zbuffer hidden surface scheme. If there are any windows
currently running in double buffer mode, the program puts an
error message on the screen because double buffering cannot
be done at the same time as zbuffering. This entry will not
be on bubble machines since there aren't enought bitplanes
for zbuffering.
-Gouraud draws the surface with the gouraud shading, but no
hidden surface removal.
Page 2 (last mod. 8/20/87)
REVOLUTION(6D) REVOLUTION(6D)
-Quick Smooth draws the surface with gouraud (smooth) shad-
ing and the cluster or BSP tree hidden surface removal
scheme. This does not require any special states or
hardware and can be run with simultaneously displayed double
buffered windows.
-BSP Flat draws the surface with the cluster or BSP tree
hidden surface scheme but with flat shaded polygons (one
color per polygon).
-Rot Sol puts up the slider bars and lets the user rotate
the smooth shaded object.
-Trans Sol puts up the slider bars and lets the user
translate the smooth shaded object.
-Rot Flat puts up the slider bars and lets the user rotate
the flat shaded object.
-Trans Flat puts up the slider bars and lets the user
translate the flat shaded object.
-Save Shape will create a file, revlib/outline.lin, that
contains the outline of the current object. This file can
be read in at a later time to reuse this object after other
objects have been created.
-Backface toggles backface removal. This allows the tree
hidden surface scheme to eliminate drawing polygons that
face away form the eye or to display all polygons regardless
of which direction the face.
-New Shape puts up a new menu asking if you really want to
start again. A yes responce will clear the object and return
to the start up mode to allow for a new shape to be entered.
A no responce will not do anything but return to the regular
program.
-Kill puts up a new menu asking if you really want to exit
the program. A yes response terminates the program. A no
responce will not do anything but return to the regular pro-
gram.
Slider Operation
When the sliders are displayed, they can be used to control
the view of the object. Move the cursor into one of the
three slider regions, which correspond to the x, y and z
axes in screen space. Press and hold the right mouse but-
ton. Without releasing the button, move the mouse from left
to right. The slider moves with the mouse, and the object
is transformed (rotated, scaled or translated) in the direc-
tion of the chosen slider (x, y or z).
Page 3 (last mod. 8/20/87)
REVOLUTION(6D) REVOLUTION(6D)
To stop displaying the sliders, move the cursor above the
region of the sliders. Now press the right mouse button.
The pop-up menu appears. Move the cursor out of the pop-up
menu and release the right mouse button so that no menu op-
tion is selected or select the desired new operation from
the menu. The sliders will have disappeared.
BUGS
In creating a shape, if the outline crosses the center line
(y axis), the program will exit.
It is recommended that the outline be made on the right side
of the center line and the points entered from top to bot-
tom. This will insure the backface command works correctly.
It is very possible to enter the points so the backfacing is
incorrect.
The cluster tree is not a complete hidden surface scheme.
Backfacing should be used with this. Therefore, the best
shapes are those whose outlines are closed (the start and
end points are the same) or whose outlines start and end on
the center line. Concavities that open to the top or to the
bottom are also poorly handled so it is best to experiment
with shapes before demoing them.
The BSP tree will handle all shapes. It should be hard to
create a shape that won't be drawn correctly. (Backface is
not necessary and can cause the image to look incorrect.
Backface will help speed up the draw time.) The BSP tree is
significantly slower than the cluster tree though. There-
fore, try to use the cluster tree for speed and the BSP tree
for complexity.
The time it takes to make a tree could be long. Using the
BSP tree on a complex shape could take a few minutes.
AUTHOR
D. Keith Seto
ORIGIN
Silicon Graphics, Inc.
Page 4 (last mod. 8/20/87)