Table of contents


NAME

SPHERES - hidden-sphere arc generator

SYNOPSIS

spheres [ -d debug-file ] [ -l listing-file ] <sphere-file >visible-arc-file

OPTIONS

spheres accepts these option switches; letter case does not matter:
-d debug-file
Specify the name of a file to contain debug output. If omitted, the name is that of the default Fortran file on unit 2 (fort.2 on many UNIX systems).
-l listing-file
Specify the name of a file to contain normal listing output. If omitted, the name is that of the default Fortran file on unit 1 (fort.1 on many UNIX systems).

DESCRIPTION

spheres reads a data file containing sphere coordinates and viewing parameters, and produces an output file of visible arcs suitable for input to sphplt(1L). The algorithm that solves the hidden sphere problem is due to W. Randolph Franklin, An Exact Hidden Sphere Algorithm That Operates in Linear Time", Computer Graphics and Image Processing, 15, 364-379 (1981). It is capable of handling scenes containing tens of thousands of spheres.

INPUT FILE

Input to spheres consists of two Fortran namelist groups, a one-line title, and then any number of (x,y,z,r) values in free format, each starting a new line.

When preparing namelist input, recall that Fortran requires that the dollar sign prefixing the namelist name must be placed in column 2, and column 1 is ignored.

Within the namelist group, variable assignments may occur in any order, separated by commas, with arbitrary whitespace between tokens. Variable assignments are done in order, so that in the event of multiple assignments to the same variable, the last one applies.

Defaults are always provided for all namelist variables, so that often empty namelist groups are sufficient.

The first namelist group is $OPTION ... $END. Its variables are:

RSCALE
Scale parameter by which the input radii are to be multiplied (default 1.0).
HMULT
Parameter which multiplied by the number of spheres is the number of entries in the intersection hash table. The default value, 6.0, should normally be adequate, but if hash table overflow occurs, or if much space is wasted, it may be adjusted up or down.
DEBUG
Set .TRUE. to produce (voluminous) debug output. The default is .FALSE.

The second namelist group is $VIEW ... $END. Its variables define the 3-D viewing parameters, following the CORE graphics system viewing model implemented in PLOT79.
REFPT(*)
(x,y,z) coordinates of view reference point.
VDIST
View distance, measured along view plane normal from view reference point.
VUP(*)
(x,y,z) coordinates of view-up vector, whose projection on the window defines the up direction.
VPN(*)
(x,y,z) coordinates of view plane normal.
PROJPT(*)
(x,y,z) coordinates of projective point.
PARLEL
Set .TRUE. for a parallel projection (the default), and .FALSE. for a perspective projection.
RIGHT
Set .TRUE. for a right-handed world coordinate system (the default), and .FALSE. for a left-handed world coordinate system.
UMIN, UMAX
Horizontal window extents in world coordinates.
VMIN, VMAX
Vertical window extents in world coordinates.
WMIN, WMAX
Depth window extents in world coordinates.
TMODEL(*,*)
4 by 4 modelling transformation matrix which is applied to the input (x,y,z) coordinates before mapping them into the window.

It is important to remember that the u,v,w window coordinate system is always left-handed, u horizontal and positive to the right, v vertical and positive upward, and w positive into the viewplane away from the viewer. The window coordinate extents both define the world coordinate units and the fraction of space which is visible, since the axes will run from *MIN to *MAX (* = U, V, W). The default world coordinate space is a unit cube (0.0 ... 1.0).

SAMPLE INPUT FILE

Here is a typical input file to spheres:

 $OPTION
        RSCALE = 1.0,
 $END
 $VIEW
      VDIST = 0.0,
      RIGHT=T,
      VPN(1) = 0,0,-1,
      UMIN= -.200, UMAX= 1.200,
      VMIN= -.200, VMAX= 1.200,
 $END
   10 Random Uniform Spheres
   .315378   .556053  -.586501   .200000
   .189592   .470446  -.788647   .200000
   .346929   .835021  -.194164   .200000
   .345721   .534616  -.297002   .200000
   .076982   .834157  -.668422   .200000
   .867727   .889766  -.304365   .200000
   .269288   .919649  -.539190   .200000
   .011906   .103208  -.621980   .200000
   .474645   .360819  -.282342   .200000
   .564105   .910374  -.653387   .200000

This particular file was generated by the companion program, randsp(1L).


SEE ALSO

plot79(1L), plot79-intro(1L), randsp(1L), sphplt(1L).

AUTHOR

Nelson H. F. Beebe, Ph.D.

Center for Scientific Computing

Department of Mathematics

220 South Physics Building

University of Utah

Salt Lake City, UT 84112

Tel: (801) 581-5254

FAX: (801) 581-4148

E-mail: <beebe@math.utah.edu>