home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 18
/
CD_ASCQ_18_111294_W.iso
/
dos
/
graphic
/
spcal20
/
spercal.doc
< prev
next >
Wrap
Text File
|
1994-09-29
|
24KB
|
795 lines
S P H E R E C A L
VERSION 2.0
WRITTEN BY: Jeff Pettyjohn
TABLE OF CONTENT
1.0 INTRODUCTION
1.1 PROGRAM DESCRIPTION
1.2 REGISTRATION
2.0 COMMAND LINE PARAMETERS
3.0 SPHERE TYPEES
3.1 SPHERES
3.2 GRIDS
3.2.1 EXTENDED OPTIONS
3.3 SPIRALS
3.3.1 MAJOR SPIRAL
3.3.2 MINOR SPIRAL
3.4 SPIKES
3.4.1 GRID
3.4.2 SPIRAL
4.0 USING THE "SPHERE.OUT" FILE
5.0 DESCRIPTIONS OF EXAMPLES
6.0 REVISION/UPDATE LIST
7.0 WHERE TO CONTACT ME
_____________________________________________________________________________
1.0 INTRODUCTION
HI, Thank you for trying spherecal. Allow me to introduce myself.
My name is Jeff. When I first wrote version 1 of this program I was a first
year student at Penn State, York Campus. Well, do to an unexpected but most
joyful baby girl, I am now working at a company called York Graphics, and
doing the best I can to try and raise a family. At York Graphics, I work
on MAC's and Scitex work stations doing page layout for magizines and school
books.
_____________________________________________________________________________
1.1 PROGRAM DESCRIPTION
Spherecal was written to provide some interesting methods of
generating ordinary spheres. By looking at "SAMPLES.GIF" you
can see several examples of the power of this program.
Spherecal supports both VIVID ver 2.x and POVRAY ver 2.x raytracers.
I also spport CTDS ( Connect The Dot Smoother ) written by
Truman Brown. However, CTDS is only supported for sphere types
SPHERES and GRIDS, and the CTDS options aren't tested.
Spherecal offers four major sphere types. They are SPHERES, GRIDS,
SPIRALS, and SPIKES. Type SPHERES calculates spheres at equal
positions vertically and horizontally around a sphere. Type GRIDS
offers the abbility to generate a grid around a sphere. SPIRALS
offers the abbility to generate a major or a ( my favorite ) minor
spiral around a sphere. Type SPIKES generates cylinders that can
protrude through the intersections of the grids or the spheres
around the major spiral. Better and more detailed descriptions will
be found further in the doc's.
It may be interesting to note the fact that all the coordinates
generated with this program were calculated using only sines and
cosines. Theres no fancy difficult equations, just points of
triangles spinning around a third or fourt axis.
_____________________________________________________________________________
1.2 REGISTRATION
This program is not crippled in any way. This program may not be
used for COMMERCIAL use with out registering it and without my
written consent. This program may be distributed freely as long as
this document, SPERCAL.EXE, and SAMPLES.GIF are included and not
altered in any way. I am asking for a $5.00 registration fee. If you
think that's too much, drop me a post-card or leave me E-mail with
your comments. Please send payments to:
Jeffrey Pettyjohn
248 Nollyn Dr.
Dallastown, PA 17313
If you make the effort to register, I will promise to write back or
drop you a line E-Mail when new releases are made. Also, your ideas
will be written into the program first.
_____________________________________________________________________________
2.0 COMMAND LINE PARAMETERS
The command line parameters for this program tells Spherecal
what type of raytracer you are using.
To use the command line parameters just type:
SPERCAL -p
or
SPERCAL /p
at the DOS prompt and hit enter. The parameters can be noted with
either a "-" or a "/" and the letter can be either upper or lower
case.
The command line parameters are:
-V or /V for VIVID 2.x raytracer
-P or /P for POVRAY 2.x raytracer
-C or /C for CTDS options ( NOTE: only works for type SPHERES
or GRIDS. )
-H or /H for the HELP screen
Note: If you do not enter a raytracer or -H for help, the program
will automatically go to the HELP screen.
_____________________________________________________________________________
3.0 SPHERE TYPES
As stated earlier, there are four major sphere types avaible
with this program. These are:
SPHERES
GRIDS
SPIRALS
SPIKES
These sphere types are explained below.
Some common questions asked while inputting sphere parameters are
Off Center Location (X Y Z) seperated by spaces:
Spherecal was origionally written for Steve Coy's raytracer VIVID.
However, if you are using POVRAY I would suggest leaving this blank
or entering zero and translating the sphere afterwards.
Do you want Beaded or Smooth (B or S)
This option tells Spherecal what look the sphere should take on.
Beaded tells Spherecal to generate only the spheres while Smooth
connects each consecutive spheres with a cylinder the same radius
as the spheres to create a smooth look. Your selection can be
made by simply pressing the corresponding letter "B" or "S". No
return is neccessary.
Radius of final sphere:
This tells Spherecal the radius of the central sphere the objects
are being generated around. You will be asked this through all
the sphere types.
_____________________________________________________________________________
3.1 SPHERES
Sphere type SPHERES will equally space a designated number of
spheres both vertically and horizontally around a central sphere.
You will be asked to enter the following parameters:
Number of horizontal spheres:
This is the number of spheres around the main
sphere. Note the different looks that can be
achieved by entering and odd or even number.
An odd number ( try 3 ) will create a star look
while an even number ( try 4 ) will create a
boxy look.
Number of vertical spheres:
This is the number of spheres up and down the
main sphere. I'd hate to admit it but there is
a bug here. If you are using POVRAY an even number
will generate a Degenerated cylinder if Smooth look
is chosen. That means a cylinder that starts and
stops at the same point. To avoid this always use
an odd number ( try 15 ) at this prompt.
Radius of each individual sphere:
This is the radius of each sphere around the main
sphere.
Radius of final sphere:
Off Center Location:
Beaded or Smooth:
These are explained above in section 3.0.
_____________________________________________________________________________
3.2 GRIDS
Sphere type GRIDS is designed to generate a grid around a central
sphere. A unique twist to this is the abbility to control the
radius of the intersection spheres and the radis of the connecting
bars. A good looking grid can be generated by making the radius
of the intersection spheres larger than the radius of the
connecting bars. These are the parameters you will be asked to
enter:
Enter vertical disections:
The vertical disections are the number of boxes
or grids generated around the main sphere.
( Try 7 )
Enter horizontal disections:
The horizontal disections are the number of boxes
or grids up andd down the main sphere.
( Try 12 )
Radius of intersection spheres:
This is the radius of each sphere located at the
intersection of the grid bars.
( Try .2 )
Radius of connector bars:
This is the radius of the bars connecting the
spheres.
( Try .09 )
Radius of final sphere;
Off Center Location:
Explained above in section 3.0.
Do you want Grids or Plates (G or P)
This option allows you to choose Grids, a grid
around a sphere or Plates, which generates a
polygon to fill each grid square. Plates are
a great addition when used as a mirrored surface
or a slightly transparent surface. Note: I wasn't
sure how to generate a 4 point polygon with POVRAY
so I generated 2 triangles for each grid plate
instead.
3.2.1 Do you want Extended Options (Y or N)
If you select No at this question the program will generate
your sphere and end. If you select Yes, these you will be
asked to enter these parameters.
Do you want START-ENDING options (Y or N)
Starting and Ending options alows control of the starting
and ending Vertical and Horizontal disections to be
generated. Try playing with this. The positions may vary
depending on how the final sphere is rotated. Lets say
Vertical disections are 12 and Horizontal disections are 12
and you only want to generate a third of the top half of
the GRID.
Enter starting vertical disection: (Try 1)
Enter ending vertical disection: (Try 5)
Enter starting Horizontal disection: (Try 7)
Enter ending Horizontal disection: (Try 12)
Do you want EXTENDED BAR OPTIONS (Y or N)
This option allows you to control which connecting
bars are to be generated. If you select no at this
point, the sphere will generate both the vertical
and horizontal bars. Here are your selections:
HORIZONTALS (Y or N)
These are the bars going around the sphere.
VERTICALS (Y or N)
These are the bars Up and Down the sphere.
LEFT > RIGHT (Y or N)
These are the bars diagonal from top left
to bottom right.
RIGHT > LEFT (Y or N)
These are the bars diagonal from top right
to bottom left.
_____________________________________________________________________________
3.3 SPIRALS
Sphere type SPIRALS will generate a spiral around a sphere. You
have the option of either a major or minor spiral as well as
controlling the thickness of the spheres at the beginning, middle
and end of the spiral. Please note: I can not take credit for
coining the phrase major and minor spirals. That credit goes to
Truman Brown and his program SPIRAL. If he doesn't take this
credit you'll have to ask him who coined this phrase. Anyway,
First you will be asked:
Do you want MAJOR or MINOR spiral (A or I)
Chose 'A' to generate a simple spiral around
a central sphere. Chose 'I' to generate a
minor spiral around the major spiral around
the central sphere. This haappens to be my
favorite option and the one I put the most
work into figuring out how to calculate.
3.3.1 MAJOR SPIRAL
Here you will be asked to enter the following parameters:
Major Spiral Direction Forwards or Backwards (F or B)
This controls which direction the major
spiral travels around the central sphere.
Number of turns around sphere: (Try 4)
These are the number of turns the major
spiral makes around the major sphere.
Number of spheres per turn: (Try 30)
Pretty self explanitory.
Starting radius of Major Spiral: (Try .05)
Middle radius of Major Spiral: (Try .25)
Ending radius of Major Spiral: (Try .05)
This controls the thickness of the major
spiral.
Radius of final sphere: (Try 2.1)
Off Center Location:
Do you want Beaded or Smooth (B or S)
These are explained above in section 3.0
3.3.2 MINOR SPIRAL
Here you will first be asked to enter major spiral
information required to calculate the minor spiral.
Note: with the minor spiral you can control the width
of the major spiral that the minor spiral is going
around as well as the beginning middle and ending
radius of the individual spheres of the minor spiral.
Major Spiral Direction Forwards or Backwards (F or B)
This controls which direction the major
spiral travels around the central sphere.
Number of turns around sphere: (Try 4)
These are the number of turns the major
spiral makes around the major sphere.
Starting radius of Major Spiral: (Try .05)
Middle radius of Major Spiral: (Try .25)
Ending radius of Major Spiral: (Try .05)
This controls the thickness of the major
spiral.
Now you will be asked to enter the MINOR SPIRAL PARAMETERS:
Minor Spiral Direction Forwards or Backwards (F or B)
This controls the direction the minor spiral
travels around the major spiral
Number of turns per turn of Major spiral: (Try 15)
Number of spheres per turn of Minor Spiral: (Try 15)
Pretty self explanitory.
Starting radius of spheres: (Try .03)
Middle radius of spheres: (Try .15)
Endind radius of spheres: (Try .03)
These control the thickness of the minor
spiral.
Radius of final sphere: (Try 2.1)
Off Center Location:
These are explained above in section 3.0
Do you want Beaded or Smooth (B or S)
One thing you want to remember with this
selection is the total number of primitives
you are generating. If you you use the
sample values offered above, you will end
up with:
4 * 15 * 15 = 900 Spheres
If you choose Smooth, you will end up with
over 1800 primitives.
_____________________________________________________________________________
3.4 SPIKES
Sphere type SPIKES is one of those that is kinda hard to explaine
in words. I would suggest that you play with this and see what
happens. The parameters for either are pretty follow the same
parameters as those of Sphere type GRIDS and MAJOR SPIRALS
described above. The only major difference is you are asked for
an inner and outer radius of the major sphere that the cones will
be generated between. You will first be asked :
Do you want spikes through a GRID or SPIRAL (G or S)
3.4.1 GRIDS
If you chose GRID, you will be generating a spike or
cone from the center of the main sphere through each
one of the intersection spheres. Extended options are
also available to control START and ENDING disections.
3.4.2 SPIRAL
If you chose SPIRAL, you will be generating a spike
or cone through each sphere of the Major spiral.
_____________________________________________________________________________
4.0 USING THE "SPHERE.OUT" FILE
The "SPHERE.OUT" is the file that contains all the coordinates
and spheres and polygons etc.. Spherecal generates. Each time you
use Spherecal, it will generate a file "SPHERE.OUT" the program
does not attempt to make a backup of a previous file, so be sure
to rename SPHERE.OUT if you intend to reuse it.
If you are using the POVRAY raytracer, Spherecal will generate
a union of objects called SPHERE. see below
/*
ENTERED PARAMETERS
*/
#declare SPHERE = union {
object { sphere.... }
object { cone... }
}
If you want to change the name of the union simple edit SPHERE to
what ever you want to call it. In order to use SPHERE.OUT in a
POV description file see below:
#include "colors.inc"
#include "shapes.inc"
camera {
location <4, 4, 4>
look_at <0, 0, 0>
}
light_source { <4, 4, 4> color red 1 green 1 blue 1 }
#include "sphere.out"
object {
SPHERE
pigment {color green 0.5 blue 1.0}
rotate <90, 0, 0>
}
The rotate function is needed to switch the Y and Z axis of the
generated file. Note: VIVID raytracer has its coordinates set as
the X axis Right to Left, the Y axis in and out of the screen,
and the Z axis up and down the screen. POVRAY raytracer switches
the Y and Z axis. This info may not be totally acurate and
there may be a better way of making this program more compatible
but using the rotate function works fine.
If you are using Steven Coy's VIVID raytracer, simple rename
"SPHERE.OUT" to " <object_name>.VO " and #include it in your
*.V Vivid scene description file. See below for an example:
#include color.vc
studio {
from 4 4 4
at 0 0 0
up 0 0 1
angle 65
antialias adaptive
threshold 4
}
light {
type point
falloff 0
position 4 3 2
color .3 .3 .3
}
surf {
diff 0 .5 1
shine 20 white
}
#include SPHERE.VO
_____________________________________________________________________________
5.0 DESCRIPTION OF EXAMPLES
Included in this ZIPped archive you should be able to find a file
called "SAMPLES.GIF". Here you can see nine sample with the #'s
1 to 9 written beside each sample. Below you can find the actual
input parameters used.
1
SPHERE TYPE = SPHERES
HORIZONTAL SPHERES = 15
VERTICAL SPHERES = 15
INDIVIDUAL SPHERE RADIUS = 0.150
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
TOTAL SPHERE RADIUS = 2.100
OUTPUT LOOK = BEADED
An additional sphere was added in the center with a radius
of 2.0
2
SPHERE TYPE = SPHERES
HORIZONTAL SPHERES = 5
VERTICAL SPHERES = 31
INDIVIDUAL SPHERE RADIUS = 0.200
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
TOTAL SPHERE RADIUS = 2.100
OUTPUT LOOK = SMOOTH
3
SPHERE TYPE = GRIDS
VERTICAL DISECTIONS = 9
HORIZONTAL DISECTIONS = 9
RADIUS OF INTERSECTION SPHERES = 0.200
RADIUS OF CONNECTING BARS = 0.140
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
TOTAL SPHERE RADIUS = 2.100
OUTPUT LOOK = GRIDS
Extended Options
Do you want START-ENDING options: NO
Do you wand EXTENDED BARS options: YES
HORIZONTALS: NO
VERTICALS: NO
LEFT > RIGHT: YES
RIGHT > LEFT: NO
An additional sphere was added to the center with a radius
of 2.1
4
SPHERE TYPE = GRIDS
VERTICAL DISECTIONS = 10
HORIZONTAL DISECTIONS = 10
RADIUS OF INTERSECTION SPHERES = 0.200
RADIUS OF CONNECTING BARS = 0.140
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
TOTAL SPHERE RADIUS = 2.100
OUTPUT LOOK = GRIDS
Extended Options
Do you want START-ENDING options: NO
Do you wand EXTENDED BARS options: YES
HORIZONTALS: NO
VERTICALS: NO
LEFT > RIGHT: YES
RIGHT > LEFT: YES
5
SPHERE TYPE = GRIDS
VERTICAL DISECTIONS = 11
HORIZONTAL DISECTIONS = 11
RADIUS OF INTERSECTION SPHERES = 0.150
RADIUS OF CONNECTING BARS = 0.060
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
TOTAL SPHERE RADIUS = 2.300
OUTPUT LOOK = GRIDS
No extended options used for this one.
6
SPHERE TYPE = SPIRALS
MAJOR SPIRAL
SPIRAL DIRECTION = FORWARD
NUMBER OF TURNS OF MAJOR SPIRAL = 5
NUMBER OF SPHERES PER TURN = 25
START RADIUS = 0.200
MIDDLE RADIUS = 0.300
END RADIUS = 0.200
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
TOTAL SPHERE RADIUS = 2.100
OUTPUT LOOK = BEADED
7
SPHERE 1 (The blue spiral)
SPHERE TYPE = SPIRALS
MAJOR SPIRAL
SPIRAL DIRECTION = FORWARD
NUMBER OF TURNS OF MAJOR SPIRAL = 5
NUMBER OF SPHERES PER TURN = 25
START RADIUS = 0.200
MIDDLE RADIUS = 0.300
END RADIUS = 0.200
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
TOTAL SPHERE RADIUS = 2.100
OUTPUT LOOK = BEADED
SPHERE 2 (The red spiral)
SPHERE TYPE = SPIRALS
MAJOR SPIRAL PARAMETERS
MAJOR SPIRAL DIRECTION = FORWARD
NUMBER OF TURNS OF MAJOR SPIRAL = 5
START RADIUS of MAJOR SPIRAL = 0.250
MIDDLE RADIUS of MAJOR SPIRAL = 0.350
END RADIUS of MAJOR SPIRAL = 0.250
MINOR SPIRAL PARAMETERS
MINOR SPIRAL DIRECTION = FORWARD
NUMBER OF TURNS OF MINOR SPIRAL = 15
NUMBER OF SPHERES PER TURN = 25
START RADIUS of SPHERES = 0.150
MIDDLE RADIUS of SPHERES = 0.150
END RADIUS of SPHERES = 0.150
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
TOTAL SPHERE RADIUS = 2.100
OUTPUT LOOK = BEADED
8
SPHERE 1 (Yellow spikes)
SPHERE TYPE = SPIKES
MAJOR SPIRAL
SPIRAL DIRECTION = FORWARD
NUMBER OF TURNS OF MAJOR SPIRAL = 7
NUMBER OF SPIKES PER TURN = 20
INNER SPHERE RADIUS = 1.000
OUTTER SPHERE RADIUS = 2.200
STARTING RADIUS OF SPIKES = .200
ENDING RADIUS OF SPIKES = 0.000
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
SPHERE 2 (Blue spiral)
SPHERE TYPE = SPIRALS
MAJOR SPIRAL
SPIRAL DIRECTION = FORWARD
NUMBER OF TURNS OF MAJOR SPIRAL = 7
NUMBER OF SPHERES PER TURN = 20
START RADIUS = 0.100
MIDDLE RADIUS = 0.250
END RADIUS = 0.100
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
TOTAL SPHERE RADIUS = 2.100
OUTPUT LOOK = BEADED
9
SPHERE 1 (Blue grid)
SPHERE TYPE = GRIDS
VERTICAL DISECTIONS = 9
HORIZONTAL DISECTIONS = 9
RADIUS OF INTERSECTION SPHERES = 0.200
RADIUS OF CONNECTING BARS = 0.100
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
TOTAL SPHERE RADIUS = 2.300
OUTPUT LOOK = GRIDS
SPHERE 2 (Red grid)
SPHERE TYPE = GRIDS
VERTICAL DISECTIONS = 9
HORIZONTAL DISECTIONS = 9
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
RADIUS OF INTERSECTION SPHERES = 0.130
RADIUS OF CONNECTING BARS = 0.050
TOTAL SPHERE RADIUS = 1.000
OUTPUT LOOK = GRIDS
SPHERE 3 (Yellow spike)
SPHERE TYPE = SPIKES
VERTICAL DISECTIONS = 9
HORIZONTAL DISECTIONS = 9
RADIUS OF INNER SPHERE = 1.000
RADIUS OF OUTTER SPHERE = 2.300
BEGINNING RADIUS OF SPIKE = 0.050
ENDING RADIUS OF SPIKE = 0.150
OFF-CENTER X AXIS = 0.000
OFF-CENTER Y AXIS = 0.000
OFF-CENTER Z AXIS = 0.000
_____________________________________________________________________________
6.0 REVISION / UPDATE LIST
Version 1.0 ... June, 1993
First release. Included VIVID raytracer options only.
Sphere types SPHERES, SPIRAL, and GRIDS.
Version 1.1 ... August, 1993
With some suggestions and help special thanks to
Truman Brown, I added CTDS options. Allowed for
upper and lower case entery of parameters. Added
Extended START - ENDING options for sphere type
GRIDS.
Version 1.2 ... December, 1993 (Not released)
Re-wrote and cleand up source code. This was mainly
due because I experienced a major hard drive crash
and dumb me I didn't back up the source code anywhere.
All I had left was a print out of the source code to
version 1.1. I now have 3 back-ups of the code in
various locations.
Version 2.0 ... September, 1994
Added POVRAY raytracer outputs. Added Extended Bar options
to sphere type GRIDS. Added the abbility to generate
a MINOR Spiral around a MAJOR Spiral. Added sphere type
SPIKES. Re-organized the input screen for a more attractive
and eye appealing look.
_____________________________________________________________________________
7.0
Well, I hope you enjoy this program. Alot of work went into
putting it all together. I know you will probably find a
bug or two in it and I'm sure you have a million of ideas
on how to make this program better. Don't forget to register
Spherecal. I can be reached at the various locations listed below:
Jeff Pettyjohn
248 Nollyn Dr.
Dallastown, PA 17313
Internet E-mail - jeff.pettyjohn@bitbytes.clark.net
TGA (The Graphics Alternative) - (510) 524-2780
You Can Call Me Ray BBS - (708) 358-5611
Bit's N Bytes BBS - (717) 757-4141