Contents of the README.DOC file
S P E R E C A L
Written By: Jeff Pettyjohn
Welcome to spherecal. This program is a result of my
first experiments in C++ programming. I hope it will suit
your fancy. I am a full-time student attending Penn State
UV studying mechanical engineering. I wanted to learn C++
programming. So, I gave it a wing and I wanted to share the
This program is written originally for Steven Coy's
VIVID version 2. I have also now added the ability to
produce CTDS outputs as well. ( I hope it works )
The spherecal executable is actually called
SPHERCAL.EXE contained in this .ZIP file. Sorry, DOS only
allows 8 character file names. TOO BAD.
Any way, spherecal will always place the calculated file
of spheres, cones, and polygons to SPHERE.VO. SO, if you have
a file named SPHERE.VO that you want to keep, you might want
to consider renaming it. Just a suggestion.
There's not too much to explain about this program, so
I'll just give a brief description of how the program works,
and let you go to explore.
First, this program was written to calculate the
location of spheres around a sphere. I built on this and
added the ability to generate grids around a sphere, and
generate a spiral around a sphere.
When running the program, SPHERCAL.EXE will first ask
you which sphere option or type you would like. The three
choices are " S " for spheres, " G " for grids, and " P " for
spirals, all of which will be described bellow.
There are now two command line parameters added. The are
-CT --- this will output CTDS coordinates
( Connect The Dot Smoother )
-XT --- this will turn on the Extended options to
be explained further in this document
These parameters are typed in directly after sphercal at the
DOS prompt. Here's an example:
SPHERCAL -CT -XT
|___|__ Don't forget the spaces
Typing this at the DOS prompt will turn on CTDS output with
the Extended Options on. It doesn't matter which order
they're entered, Or if they're in capitol or lowercase
Please note, all the descriptions and calculations are
based on the assumption that in the STUDIO set up for your
scene, the Z axis is up, the X axis is right to left, and the
Y axis moves in and out of the screen. This can be
accomplished by setting: UP 0 0 1 , in the studio. The output
file, " SPHERE.VO ", can be included into your scene by the
statement: #include SPHERE.VO , directly after your surface
TYPE : SPHERES
Spheres will calculate the location of spheres around a
central sphere. Sphercal will ask for the number of
horizontal and vertical spheres. The horizontal spheres are
those around the Z axis, and the vertical spheres are those
that go up and down the Z axis. I hope that clears things up
a bit. Any way, Sphercal asks for the radius of each
individual sphere and the radius of the main sphere ( the
sphere that the other spheres are to be placed around ),
fairly obvious hopefully. Spherecal also asks for the Off
center location separated by spaces. Sphercal assumes the
main sphere is located at 0-X 0-Y 0-Z in your scene. If you
wish to change this, simply enter the new location at this
prompt like this:
3 -15 100
DON'T FORGET THE SPACES
Sphercal will also ask for Beaded or Smooth. Beaded means
that only the spheres will be generated. Smooth means that a
cone will be generated connecting the spheres.
This part of the program is a little buggy; but it
creates some interesting outputs. So I decided to let it be.
Try entering 3 for horizontal spheres, and 12 for vertical
spheres, fill in the other values, choose the SMOOTH option,
and see what you get.
If the CTDS Output is on, Only the spheres X Y Z
location and the sphere's radius will be output to
SPHERE.VO. SPHERCAL also will ask you for the number of
coordinates to be generated befor placing a blank line.
This file can then be used for CTDS.
As for now, there are no Extended options available for
Type SPHERES. Your welcome to use the -XT when using this
type; but it won't do anything.
TYPE : GRIDS
This is one of my favorite types. Sphercal asks for # of
vertical disections. These are the ones going up and down the
sphere or Z axis. Sphercal will then ask you for # of
horizontal disections. These are the ones around the Z axis.
The radius of the intersection spheres are those place at the
intersection of each grid, and the radius of the connecting
bars controls the thickness of the cones that connect the
spheres. To understand this better try an intersection radius
of 4 and a connecting bar radius of 2 around a final sphere
of 40. Sphercal also asks if you want Grids or Plates. The
Grids option creates the grid around the sphere as explained
above. The Plates option will place a polygon with points at
each intersection. The Intersection spheres and connector
bars will not be generated with this option.
If the Extended options are on, You can also control the
starting and ending vertical and horizontal disections. This
may require some playing around to get the desired view (
depending on which part of the sphere you don't want ), But
for a point of reference, here it goes. If the camera is on a
positive Y axis and is looking directly at the sphere, the
sphere will start being generated from the left, swing
around the Y axis towards the camera, and then continue
around to the back of the sphere. The grid is also generated
from top to bottom at the same time. Thats the best and
easiest description I could come up with. So, If you come up
with a better one, I'm open to suggestions.
The CTDS output options are effective here as well; but
it is untested. I'm not exactly sure how well it works. If
someone out there plays with this option, let me know how it
TYPE : SPIRALS
Spherecal first asks you if you want the spiral to turn
Forwards or Backwards around the Z axis or sphere. Assuming
the camera is on a positive Y axis, Forwards will calculate
the spiral turning counter-clock wise. Sphercal also asks for
the number of turns around the sphere. Sorry, only whole
number of turns for now. You can control the thickness of the
sphere at three locations, the beginning, middle and end of
the spiral. The Off-center location and Beaded or Smooth
options were discussed in TYPE : SPHERES, and work the same
way here. CTDS options are available here as well. Sorry,
There aren't any extended options for this yet; but stay
The best way to understand all this is to try some values and
see what you get. OK. Now for the legal junk.
Nothing special. This program is free for distribution
for NONCOMMERCIAL USE ONLY as long at this documentation and
SPHERCAL.EXE are distributed together, and that no
modifications are made to either. I am not asking for any
registration fee or anything like that. Just knowing that
you actually read this far puts a grin on my face. HA HA.
However, I would love to hear your comments on this program
and if your really moved to, I wouldn't reject any donations
for my college education sent to the address below.
248 Nollyn Drive
Dallastown, PA 17313
I can also be contacted at:
CompuServe ID# 76640,163
"The Graphics Alternative" (510) 524-2780
You Can Call Me Ray BBS (708) 358-5611
Hope you enjoy!!!!
I just wanted to give a special thanks to Truman Brown for
all his help and suggestions to make this program better.