Home » Archimedes archive » Acorn User » AU 1994-01.adf » !FEMS_App_FEMS_App » FEMSdoc

FEMSdoc

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1994-01.adf » !FEMS_App_FEMS_App
Filename: FEMSdoc
Read OK:
File size: 4D86 bytes
Load address: 0000
Exec address: 0000
File contents
This file describes, in a more complete way than the magazine article, the
syntax of script files for FEMS version 2.21.  In the interests of clarity,
some parts of the article are also included in this file.


DESIGNING YOUR OWN SCENES

     To give maximum flexibility in the setting up of simulations, and
because there are so many possibilities, the scene and parameters are
described in a text file "script" which tells the program what to do.  Even
if you don't feel up to creating your own scenes, fiddling with the provided
definition files will allow you to change things like the screen resolution,
rendering style (whether the picture is drawn with dots or lines) and the
viewpoint used.  Since the simulation setup files are just text files, they
can be created and modified in Edit or any other text editor.  The magazine
explains the general idea of script files and some hints for the successful
creation of animations.

SCRIPT FILES: GENERAL

1    The first line of a script must be "FEMS2".  This is so the program can
recognize valid definition files, and knows which version they are.

2    The program doesn't care whether the letters in the script are upper or
lower case, as it converts them all to lower case when it reads the file.

3    Lines can be concatenated by replacing a newline with a colon, and
spaces can be used instead of commas if you wish.

4    Comments are anything between a /* and a */ (like in C), and are
ignored.  Comments can be nested.

5    A "block" consists of a block name followed by several commands
enclosed in curly brackets.  The brackets must have a separator to either
side of them ie. use "rendering { type dots }" not "rendering{ type dots}"

6    A script consists of some global parameters, a "rendering" block, and
any number of "solid" and "background" blocks.

GLOBAL PARAMETERS
     There are three global parameter commands:
          frame_aim <number>
          gravity <number>,<number>,<number>
          time_div <number>
     The number after frame_aim is the number of frames you want to aim for. 
All this does is cause the program to pause after that many frames, so you
don't overshoot if the computer is being left unattended.  It also sets the
number of frames used to estimate the finishing time.  If the program has
continued past the aim point, or there is not enough space to store the
number of frames aimed for, the finishing time is based on the estimated
maximum number of frames.

     "Gravity" sets the direction and speed with which things fall.  There
are three numbers for the amounts in the x, y and z directions.  Normally
these will be something like 0, 0  and -600 so things fall downwards.  The
script "UpStairs" uses a sideways gravity to make the cube appear to climb
the stairs.

     The "time_div" command sets the number of times the finite element
simulation procedures are called between frames, or in other words how
finely divided the time steps are.  The number must be a power of 2, eg.
1,2,4,8 etc.  The main purpose of this is to allow objects to be stiffer
without exploding, so the spring constants in the objects are automatically
increased when this value is increased.

THE RENDERING BLOCK
     The other set of options affects the appearance of the picture on the
screen.  This is called the "rendering block" and looks like this:
 
          rendering {
           type <render_type>
           resolution <number>,<number>
           view <number>,<number>
           background <back_type>
          }

     <render_type> is one of "dots", "lines", "all_dots" or "wireframe". 
"Dots" draws the points at the corners of the surface facets, and "lines"
draws the edges of the surface facets.  The other two options do the same
but without removing hidden surfaces.  The "dots" option uses the least
memory for frame storage, and "all_dots" is the quickest to draw.

     The "resolution" command lets you choose the screen resolution you want
to use, by specifying the number of horizontal and vertical pixels.  Useful
values are 320,256 (low resolution) 640,256 (high resolution) and 640,512
(multisync monitors), but you can use any resolution for which there is a
screen mode.  The program will give an error of there is no mode which fits. 
When choosing a resolution, bear in mind that higher resolutions will take
more frame storage space.

     "View" specifies the angle from which you look at the scene.  The
numbers are angles in degrees, the first being the direction in the x-y
plane.  This is the angle through which the scene is rotated about the
vertical axis.  If this is 0, the x direction is horizontally across your
screen (+x on the right, -y on the left) and the +y direction is out of the
screen towards you.  The second number is the "elevation": an value of zero
will put the viewpoint on the x-y plane (looking horizontally, +z axis
vertically upwards), and an angle of 90 would have you looking directly down
from above.

     The "background" command is optional: if you include "background back"
in the rendering block, the program assumes that the background object(s)
are always behind the solid object(s), and does not redraw the background
every frame.  This is useful, for example, when the background is a set of
stairs, as it reduces the frame drawing time.  The default setting is
"background mix" which lets the background object(s) be partly in front of
and partly behind the solid(s).

     The order in which any of the above options are arranged does not
matter, as long as the rendering options are kept inside the rendering
block.

     CREATING OBJECTS: BACKGROUND OBJECTS
     Background objects are the fixed pieces of scenery which the moving
objects interact with.  You can have as many background objects as you want:
they are all created at the origin but they can be moved to any position.
     The script to create a background object is as follows:
          background {
           create {
            type <object_type>
            points <points_spec>
            size <size_spec>
           }
           translate <x>,<y>,<z>
          }
     The indentation is optional: it was added for clarity.  The first thing
in a background block must be a create block, and there must be only one of
these.  The translate command is optional, and there may be any number of
these.  The three parameters are the amounts by which to move the object in
the x, y and z directions.  All distances should be followed by a unit, eg
3.3in (with no separating space).  Units recognized are in, ft, cm and mm. 
The default unit is 1/640 of a printer's point (a very small distance), so
if the translate command has no visible effect, check the units.
     The first word in the create block must be "type", because the effect
of the "points" and "size" commands are dependant on the object type.  For a
background object, <object_type> must be one of "sheet", "sphere" or
"stairs".

THE SPHERE OBJECT
     This has one "points" parameter and one "size" parameter, i.e. the word
"points" must be followed by one number, and "size" must be followed by a
distance.  The previous remarks about units for distances also apply to all
size parameters.  The size parameter for a sphere sets its radius.  The
points parameter sets the number of points used to draw the sphere: if this
parameter is P, the number of points used is 2 x P x P.  There are P rings
of points, each containing 2P points.  12 is an adequate value for this
parameter.
     You should avoid creating objects which extend into a sphere, because
these will be ejected outwards violently.

THE SHEET OBJECT
     This has one "points" parameter and one "size" parameter.  Sheets are
always square: the points parameter sets the number of points along one
side, and the size parameter sets the length of one side.  For example, if
you use "points 21" and "size 5in" the program will create a sheet with 21 x
21 = 441 points, so if you use "lines" as the rendering type the sheet will
be divided into 20 x 20 squares, each 0.25in x 0.25in.  The sheet is created
horizontal (ie. on the x-y plane) and centred on the origin, so in the above
example the sheet would extend from -5in to +5in in the x direction, from
-5in to +5in in the y direction, and have z=0 for all points.
     When the sheet is created as a background object, it defines a "floor". 
No solid will be allowed to pass below the height of the sheet.  You should
avoid creating objects which extend below the floor, because these will be
ejected upwards violently.  Note that the floor effect does not depend on
the size of the sheet, only on its vertical position.: the effective floor
is an infinite plane at the same height as the sheet.  If you wanted an
invisible floor, therefore, you could create a small sheet with points set
to 2, and move it out of sight in the x or y direction.

THE STAIRS OBJECT
     Being a more complex object, this takes three points parameters and
three size parameters.  Just to confuse things, the points parameters do not
correspond to the same features as the size parameters, unlike the other
objects.  Let's take the size parameters first; these are:
          size <step_width>,<step_height>,<step_depth>
     These are quite obvious: <step_width> is the width of the steps along
the x axis (see diagram below), <step_height> is the amount you would have
to lift your feet (z direction) and <step_depth> is the amount of room you
have for your feet on each step (y direction).
     The points parameters are:
          points <pts_width>,<steps>,<pts_depth>
     The first and third of these just set the number of points used to draw
the horizontal part of the steps: the second is unusual in that it changes
the size of the object, since it sets the number of steps.

               +
               |\
           +---+ \     Axes:
           |\   \ \      z
       +---+ \   \ +     |
       |\   \ \   \|     |
   +---+ \   \ +---+     *-----y
    \   \ \   \|          \
     O   \ +---+           \
      \   \|                x
       +---+                        O is the position of the origin

     The above diagram shows the orientation and initial position of the
stairs.  You will normally want to translate the stairs in the -y,-z
direction after creating them.  Note that due to the orientation, the first
view parameter will need to be between 90 and 270 for the viewpoint to be on
the right side of the stairs.
     Like the sheet, the extent of the stairs is in fact infinite: solids do
not fall off the sides of the stairs, and the stairs continue above and
below those which are visible.


     CREATING OBJECTS: SOLID OBJECTS

          solid {
           create {
            type <object_type>
            points <points_spec>
            size <size_spec>
           }
           scale <xs>,<ys>,<zs>
           nearbonds {
            spring_const <lambda>
            range <range_val>
           }
           damping <damp_val>
           <other commands>
          }
     The block to create a solid starts with a "create" block, like
backgrounds.  The only difference here is the choice of objects you can
create: a sheet, a cuboid, a cube, a tube or a compound object.  These will
be described individually later.
     The scale command is optional: it lets you scale an object in the x, y
and z directions.  This command is mainly present to allow you to change the
size of a compound object, which would otherwise be very tedious.  I would
advise that you keep the x, y and z scalings similar, as objects which have
different point spacings in different directions tend to be unstable.  The
scale command goes before nearbonds because otherwise would get stretched:
you may want to use this effect, but keep the scale factors close to 1 to
prevent explosions.

     The "nearbonds" block is what makes the solid a solid.  It needs to be
put after the "create" block, because it creates all the little springs
which hold the points in the object together.  It is called "nearbonds"
because it only bonds together points which are fairly close.  The number
after "spring_const" sets the stiffness of the springs, and "range" sets how
near two points have to be for a spring to connect them.  For each object,
the program works out an average "nearest-neighbour" distance (call this D),
and the "range" value is in terms of D.  Points with a separation of between
D/2 and D are linked with a spring of strength <lambda>, and points with a
separation between D and D*<range_val> are linked with a spring of strength
which decreases smoothly down to 0 for D*<range_val>.   Points with a
separation of less than D/2 are not connected.
     The "damping" command should be followed by a single integer: 3 or 4
are typical values.  Solid objects need have the motion of their points
"damped", otherwise the springs would make them vibrate out of control. 
Unfortunately, the damping also has the effect of stopping the whole object
moving or rotating very quickly, so things sometimes look as if they are
underwater.  Generally, you will want the smallest value of damping which is
sufficient to stop the thing exploding.

     OTHER COMMANDS
     There are two commands you can use to place the object where you want
it:
          translate <x>,<y>,<z>
          rotate <xr>,<yr>,<zr>
     The translate command has been described above.  The rotate command
rotates the object ABOUT THE ORIGIN.  It rotates by <xr>, <yr> and <zr>
degrees about the x, y, and z axes respectively.  You can have any number of
translate and rotate commands without fear of slowing down the program,
because the commands only affect the initial setting up.  For example, if
you want to rotate by 15 degrees about the point (1in,1in,2in), around the x
axis, you could use:
          translate -1in,-1in,-2in
          rotate 15,0,0       
          translate 1in,1in,2in
     and then translate the solid to where you want it.
     There are another two commands which can go in a solid block, but these
should only be given once in each solid.  They are:
          velocity <xv>,<yv>,<zv>
          pull <first>,<last>,<step>,<xv>,<yv>,<zv>
     The "velocity" command just gives the object an initial velocity.  Use
trial and error to find the best value, but the size of numbers will need to
be around a few thousands (a setting of 1843 is 1 inch per second).  Note
that high velocities will quickly be damped down.
     The "pull" command is rather low-level: it needs to refer to the
numbering of the points in an object.  The first three parameters are like a
FOR-NEXT loop which defines a set of points, and these points are given a
fixed velocity given by the last three parameters.  Look at the simulation
script "ClothPull" for an example of the use of this command.

THE CUBOID OBJECT
     To create a cuboid, use the following parameters in the "create" block:
          type cuboid
          size <x_size>,<y_size>,<z_size>
          points <x_pts>,<y_pts>,<z_pts>
     The meaning of the parameters is hopefully obvious.  It is a good idea
to keep the separation of the points the same in all three directions, ie.
<size>/<pts> should be similar for x, y and z.

THE CUBE OBJECT
     The setup for a cube is:      
          type cube
          size <size>
          points <pts>
     This is basically the same as a cuboid, except the parameters for the
three directions are all set to be equal.

THE TUBE OBJECT       
          type tube
          size <length>,<radius>,<thickness>
          points <length_pts>,<circ_points>,<thick_points>
     The <length> parameter sets the length of the tube.  <Radius> sets the
distance from the axis of the tube to the centre of its walls, and
<thickness> sets the wall thickness.
     The three points parameters set the number of points along the length,
around the circumference and across the wall respectively.
     As I mentioned earlier, it is a good idea to keep the
"nearest-neighbour" distance fairly constant, so as a rough guide, try to
keep:
          <length_pts>   <circ_points>   <thick_points>
          ------------ = ------------- = --------------
            <length>     2*PI*<radius>    <thickness>
     and
          <radius> > 2*<thickness>
     These are only approximate rules, so feel free to try things out and
see what happens.


COMPOUND OBJECTS
     Compound objects let you stick together any number of other solids to
create a more complex object.  Here is an example of how a compound object
might look:
          create {
           type compound
           part {
            type cuboid
            points 7,3,3
            size 3in,1in,1in
            offset 1in,0,0
           }
           part { type cuboid:points 3,3,11:size 1in,1in,5in }
           part { type cuboid:points 3,7,3:size 1in,3in,1in:offset 0,1in,0 }
          }
     The first line in the "create" block is "type compound", then there is
a list of "part" blocks.  Each of these is much like a "create" block (it
has type, size and points commands), but with the following differences: 1    
You can add an "offset" command at the end 2     You cannot have a compound
type object as a part!
     The "offset" command is exactly equivalent to a "translate" command,
but only applies to the particular part whose block it is in.
     In the example above, the first "part" block is written out with one
command per line, but the rest are contracted onto one line each by
replacing newlines with colons.  Remember that the curly brackets must be
separated from the commands, else you will get an error.  There is no limit
on the number of parts a compound object can have.  Compound solids work by
letting you create several objects before you use the "nearbonds" command. 
When you do use this command, it connects the parts together.  This method
means that parts will not get connected if they are separated by more than
the range of the "nearbonds" command.  You should also not let parts pass
through each other, as the resulting compound object is unstable.  Since the
nearbonds routine is working on all the parts in one go, you should also
keep the nearest-neighbour distances for all the parts similar.

GETTING SCREENSHOTS
     There is no built-in facility for obtaining screenshots, but it is
simple to do this by adding a line to PROCframe_actions in the program. 
This procedure is called after each frame has been drawn, with the frame
number passed in frame%.  To save a picture of frame 30, add a line at the
beginning of PROCframe_actions which says:
          IF frame%=30 THEN *ScreenSave FEMSpic30
     You could also make the ScreenSave conditional on the Alt key being
held down, for example.

FACET OUTPUT
     I have included in the program a facility to output the coordinates of
all the triangular "facets" which make up the surfaces of the objects.  You
could use this data to create an input file for a ray tracer or other 3D
rendering program.  As for screenshots, you just add a line to
PROCframe_actions like:
          IF frame%=30 THEN PROCoutput_facets("$.Temp.facets30")
     which will create a data file when the program reaches the 30th frame. 
The data file consists of a list of numbers which can the read by a
          INPUT#chan%,A%
     type BASIC statement.  You can read the file with a program which looks
something like this:

          REPEAT
           INPUT#chan%,A%
           IF A%<>1 THEN ERROR 1,"Bad file"
           INPUT#chan%,N%
           FOR i%=1 TO N%
            INPUT#chan%,X1%,Y1%,Z1%
            INPUT#chan%,X2%,Y2%,Z2%
            INPUT#chan%,X3%,Y3%,Z3%
            REM do something with the data here
           NEXT
          UNTIL EOF#chan%

     The coordinates of the three corners of each facet are given in units
of 1/640th of a point, which is 1/&B400 of an inch.

     Have fun!
00000000  54 68 69 73 20 66 69 6c  65 20 64 65 73 63 72 69  |This file descri|
00000010  62 65 73 2c 20 69 6e 20  61 20 6d 6f 72 65 20 63  |bes, in a more c|
00000020  6f 6d 70 6c 65 74 65 20  77 61 79 20 74 68 61 6e  |omplete way than|
00000030  20 74 68 65 20 6d 61 67  61 7a 69 6e 65 20 61 72  | the magazine ar|
00000040  74 69 63 6c 65 2c 20 74  68 65 0a 73 79 6e 74 61  |ticle, the.synta|
00000050  78 20 6f 66 20 73 63 72  69 70 74 20 66 69 6c 65  |x of script file|
00000060  73 20 66 6f 72 20 46 45  4d 53 20 76 65 72 73 69  |s for FEMS versi|
00000070  6f 6e 20 32 2e 32 31 2e  20 20 49 6e 20 74 68 65  |on 2.21.  In the|
00000080  20 69 6e 74 65 72 65 73  74 73 20 6f 66 20 63 6c  | interests of cl|
00000090  61 72 69 74 79 2c 0a 73  6f 6d 65 20 70 61 72 74  |arity,.some part|
000000a0  73 20 6f 66 20 74 68 65  20 61 72 74 69 63 6c 65  |s of the article|
000000b0  20 61 72 65 20 61 6c 73  6f 20 69 6e 63 6c 75 64  | are also includ|
000000c0  65 64 20 69 6e 20 74 68  69 73 20 66 69 6c 65 2e  |ed in this file.|
000000d0  0a 0a 0a 44 45 53 49 47  4e 49 4e 47 20 59 4f 55  |...DESIGNING YOU|
000000e0  52 20 4f 57 4e 20 53 43  45 4e 45 53 0a 0a 20 20  |R OWN SCENES..  |
000000f0  20 20 20 54 6f 20 67 69  76 65 20 6d 61 78 69 6d  |   To give maxim|
00000100  75 6d 20 66 6c 65 78 69  62 69 6c 69 74 79 20 69  |um flexibility i|
00000110  6e 20 74 68 65 20 73 65  74 74 69 6e 67 20 75 70  |n the setting up|
00000120  20 6f 66 20 73 69 6d 75  6c 61 74 69 6f 6e 73 2c  | of simulations,|
00000130  20 61 6e 64 0a 62 65 63  61 75 73 65 20 74 68 65  | and.because the|
00000140  72 65 20 61 72 65 20 73  6f 20 6d 61 6e 79 20 70  |re are so many p|
00000150  6f 73 73 69 62 69 6c 69  74 69 65 73 2c 20 74 68  |ossibilities, th|
00000160  65 20 73 63 65 6e 65 20  61 6e 64 20 70 61 72 61  |e scene and para|
00000170  6d 65 74 65 72 73 20 61  72 65 0a 64 65 73 63 72  |meters are.descr|
00000180  69 62 65 64 20 69 6e 20  61 20 74 65 78 74 20 66  |ibed in a text f|
00000190  69 6c 65 20 22 73 63 72  69 70 74 22 20 77 68 69  |ile "script" whi|
000001a0  63 68 20 74 65 6c 6c 73  20 74 68 65 20 70 72 6f  |ch tells the pro|
000001b0  67 72 61 6d 20 77 68 61  74 20 74 6f 20 64 6f 2e  |gram what to do.|
000001c0  20 20 45 76 65 6e 0a 69  66 20 79 6f 75 20 64 6f  |  Even.if you do|
000001d0  6e 27 74 20 66 65 65 6c  20 75 70 20 74 6f 20 63  |n't feel up to c|
000001e0  72 65 61 74 69 6e 67 20  79 6f 75 72 20 6f 77 6e  |reating your own|
000001f0  20 73 63 65 6e 65 73 2c  20 66 69 64 64 6c 69 6e  | scenes, fiddlin|
00000200  67 20 77 69 74 68 20 74  68 65 20 70 72 6f 76 69  |g with the provi|
00000210  64 65 64 0a 64 65 66 69  6e 69 74 69 6f 6e 20 66  |ded.definition f|
00000220  69 6c 65 73 20 77 69 6c  6c 20 61 6c 6c 6f 77 20  |iles will allow |
00000230  79 6f 75 20 74 6f 20 63  68 61 6e 67 65 20 74 68  |you to change th|
00000240  69 6e 67 73 20 6c 69 6b  65 20 74 68 65 20 73 63  |ings like the sc|
00000250  72 65 65 6e 20 72 65 73  6f 6c 75 74 69 6f 6e 2c  |reen resolution,|
00000260  0a 72 65 6e 64 65 72 69  6e 67 20 73 74 79 6c 65  |.rendering style|
00000270  20 28 77 68 65 74 68 65  72 20 74 68 65 20 70 69  | (whether the pi|
00000280  63 74 75 72 65 20 69 73  20 64 72 61 77 6e 20 77  |cture is drawn w|
00000290  69 74 68 20 64 6f 74 73  20 6f 72 20 6c 69 6e 65  |ith dots or line|
000002a0  73 29 20 61 6e 64 20 74  68 65 0a 76 69 65 77 70  |s) and the.viewp|
000002b0  6f 69 6e 74 20 75 73 65  64 2e 20 20 53 69 6e 63  |oint used.  Sinc|
000002c0  65 20 74 68 65 20 73 69  6d 75 6c 61 74 69 6f 6e  |e the simulation|
000002d0  20 73 65 74 75 70 20 66  69 6c 65 73 20 61 72 65  | setup files are|
000002e0  20 6a 75 73 74 20 74 65  78 74 20 66 69 6c 65 73  | just text files|
000002f0  2c 20 74 68 65 79 0a 63  61 6e 20 62 65 20 63 72  |, they.can be cr|
00000300  65 61 74 65 64 20 61 6e  64 20 6d 6f 64 69 66 69  |eated and modifi|
00000310  65 64 20 69 6e 20 45 64  69 74 20 6f 72 20 61 6e  |ed in Edit or an|
00000320  79 20 6f 74 68 65 72 20  74 65 78 74 20 65 64 69  |y other text edi|
00000330  74 6f 72 2e 20 20 54 68  65 20 6d 61 67 61 7a 69  |tor.  The magazi|
00000340  6e 65 0a 65 78 70 6c 61  69 6e 73 20 74 68 65 20  |ne.explains the |
00000350  67 65 6e 65 72 61 6c 20  69 64 65 61 20 6f 66 20  |general idea of |
00000360  73 63 72 69 70 74 20 66  69 6c 65 73 20 61 6e 64  |script files and|
00000370  20 73 6f 6d 65 20 68 69  6e 74 73 20 66 6f 72 20  | some hints for |
00000380  74 68 65 20 73 75 63 63  65 73 73 66 75 6c 0a 63  |the successful.c|
00000390  72 65 61 74 69 6f 6e 20  6f 66 20 61 6e 69 6d 61  |reation of anima|
000003a0  74 69 6f 6e 73 2e 0a 0a  53 43 52 49 50 54 20 46  |tions...SCRIPT F|
000003b0  49 4c 45 53 3a 20 47 45  4e 45 52 41 4c 0a 0a 31  |ILES: GENERAL..1|
000003c0  20 20 20 20 54 68 65 20  66 69 72 73 74 20 6c 69  |    The first li|
000003d0  6e 65 20 6f 66 20 61 20  73 63 72 69 70 74 20 6d  |ne of a script m|
000003e0  75 73 74 20 62 65 20 22  46 45 4d 53 32 22 2e 20  |ust be "FEMS2". |
000003f0  20 54 68 69 73 20 69 73  20 73 6f 20 74 68 65 20  | This is so the |
00000400  70 72 6f 67 72 61 6d 20  63 61 6e 0a 72 65 63 6f  |program can.reco|
00000410  67 6e 69 7a 65 20 76 61  6c 69 64 20 64 65 66 69  |gnize valid defi|
00000420  6e 69 74 69 6f 6e 20 66  69 6c 65 73 2c 20 61 6e  |nition files, an|
00000430  64 20 6b 6e 6f 77 73 20  77 68 69 63 68 20 76 65  |d knows which ve|
00000440  72 73 69 6f 6e 20 74 68  65 79 20 61 72 65 2e 0a  |rsion they are..|
00000450  0a 32 20 20 20 20 54 68  65 20 70 72 6f 67 72 61  |.2    The progra|
00000460  6d 20 64 6f 65 73 6e 27  74 20 63 61 72 65 20 77  |m doesn't care w|
00000470  68 65 74 68 65 72 20 74  68 65 20 6c 65 74 74 65  |hether the lette|
00000480  72 73 20 69 6e 20 74 68  65 20 73 63 72 69 70 74  |rs in the script|
00000490  20 61 72 65 20 75 70 70  65 72 20 6f 72 0a 6c 6f  | are upper or.lo|
000004a0  77 65 72 20 63 61 73 65  2c 20 61 73 20 69 74 20  |wer case, as it |
000004b0  63 6f 6e 76 65 72 74 73  20 74 68 65 6d 20 61 6c  |converts them al|
000004c0  6c 20 74 6f 20 6c 6f 77  65 72 20 63 61 73 65 20  |l to lower case |
000004d0  77 68 65 6e 20 69 74 20  72 65 61 64 73 20 74 68  |when it reads th|
000004e0  65 20 66 69 6c 65 2e 0a  0a 33 20 20 20 20 4c 69  |e file...3    Li|
000004f0  6e 65 73 20 63 61 6e 20  62 65 20 63 6f 6e 63 61  |nes can be conca|
00000500  74 65 6e 61 74 65 64 20  62 79 20 72 65 70 6c 61  |tenated by repla|
00000510  63 69 6e 67 20 61 20 6e  65 77 6c 69 6e 65 20 77  |cing a newline w|
00000520  69 74 68 20 61 20 63 6f  6c 6f 6e 2c 20 61 6e 64  |ith a colon, and|
00000530  0a 73 70 61 63 65 73 20  63 61 6e 20 62 65 20 75  |.spaces can be u|
00000540  73 65 64 20 69 6e 73 74  65 61 64 20 6f 66 20 63  |sed instead of c|
00000550  6f 6d 6d 61 73 20 69 66  20 79 6f 75 20 77 69 73  |ommas if you wis|
00000560  68 2e 0a 0a 34 20 20 20  20 43 6f 6d 6d 65 6e 74  |h...4    Comment|
00000570  73 20 61 72 65 20 61 6e  79 74 68 69 6e 67 20 62  |s are anything b|
00000580  65 74 77 65 65 6e 20 61  20 2f 2a 20 61 6e 64 20  |etween a /* and |
00000590  61 20 2a 2f 20 28 6c 69  6b 65 20 69 6e 20 43 29  |a */ (like in C)|
000005a0  2c 20 61 6e 64 20 61 72  65 0a 69 67 6e 6f 72 65  |, and are.ignore|
000005b0  64 2e 20 20 43 6f 6d 6d  65 6e 74 73 20 63 61 6e  |d.  Comments can|
000005c0  20 62 65 20 6e 65 73 74  65 64 2e 0a 0a 35 20 20  | be nested...5  |
000005d0  20 20 41 20 22 62 6c 6f  63 6b 22 20 63 6f 6e 73  |  A "block" cons|
000005e0  69 73 74 73 20 6f 66 20  61 20 62 6c 6f 63 6b 20  |ists of a block |
000005f0  6e 61 6d 65 20 66 6f 6c  6c 6f 77 65 64 20 62 79  |name followed by|
00000600  20 73 65 76 65 72 61 6c  20 63 6f 6d 6d 61 6e 64  | several command|
00000610  73 0a 65 6e 63 6c 6f 73  65 64 20 69 6e 20 63 75  |s.enclosed in cu|
00000620  72 6c 79 20 62 72 61 63  6b 65 74 73 2e 20 20 54  |rly brackets.  T|
00000630  68 65 20 62 72 61 63 6b  65 74 73 20 6d 75 73 74  |he brackets must|
00000640  20 68 61 76 65 20 61 20  73 65 70 61 72 61 74 6f  | have a separato|
00000650  72 20 74 6f 20 65 69 74  68 65 72 0a 73 69 64 65  |r to either.side|
00000660  20 6f 66 20 74 68 65 6d  20 69 65 2e 20 75 73 65  | of them ie. use|
00000670  20 22 72 65 6e 64 65 72  69 6e 67 20 7b 20 74 79  | "rendering { ty|
00000680  70 65 20 64 6f 74 73 20  7d 22 20 6e 6f 74 20 22  |pe dots }" not "|
00000690  72 65 6e 64 65 72 69 6e  67 7b 20 74 79 70 65 20  |rendering{ type |
000006a0  64 6f 74 73 7d 22 0a 0a  36 20 20 20 20 41 20 73  |dots}"..6    A s|
000006b0  63 72 69 70 74 20 63 6f  6e 73 69 73 74 73 20 6f  |cript consists o|
000006c0  66 20 73 6f 6d 65 20 67  6c 6f 62 61 6c 20 70 61  |f some global pa|
000006d0  72 61 6d 65 74 65 72 73  2c 20 61 20 22 72 65 6e  |rameters, a "ren|
000006e0  64 65 72 69 6e 67 22 20  62 6c 6f 63 6b 2c 20 61  |dering" block, a|
000006f0  6e 64 0a 61 6e 79 20 6e  75 6d 62 65 72 20 6f 66  |nd.any number of|
00000700  20 22 73 6f 6c 69 64 22  20 61 6e 64 20 22 62 61  | "solid" and "ba|
00000710  63 6b 67 72 6f 75 6e 64  22 20 62 6c 6f 63 6b 73  |ckground" blocks|
00000720  2e 0a 0a 47 4c 4f 42 41  4c 20 50 41 52 41 4d 45  |...GLOBAL PARAME|
00000730  54 45 52 53 0a 20 20 20  20 20 54 68 65 72 65 20  |TERS.     There |
00000740  61 72 65 20 74 68 72 65  65 20 67 6c 6f 62 61 6c  |are three global|
00000750  20 70 61 72 61 6d 65 74  65 72 20 63 6f 6d 6d 61  | parameter comma|
00000760  6e 64 73 3a 0a 20 20 20  20 20 20 20 20 20 20 66  |nds:.          f|
00000770  72 61 6d 65 5f 61 69 6d  20 3c 6e 75 6d 62 65 72  |rame_aim <number|
00000780  3e 0a 20 20 20 20 20 20  20 20 20 20 67 72 61 76  |>.          grav|
00000790  69 74 79 20 3c 6e 75 6d  62 65 72 3e 2c 3c 6e 75  |ity <number>,<nu|
000007a0  6d 62 65 72 3e 2c 3c 6e  75 6d 62 65 72 3e 0a 20  |mber>,<number>. |
000007b0  20 20 20 20 20 20 20 20  20 74 69 6d 65 5f 64 69  |         time_di|
000007c0  76 20 3c 6e 75 6d 62 65  72 3e 0a 20 20 20 20 20  |v <number>.     |
000007d0  54 68 65 20 6e 75 6d 62  65 72 20 61 66 74 65 72  |The number after|
000007e0  20 66 72 61 6d 65 5f 61  69 6d 20 69 73 20 74 68  | frame_aim is th|
000007f0  65 20 6e 75 6d 62 65 72  20 6f 66 20 66 72 61 6d  |e number of fram|
00000800  65 73 20 79 6f 75 20 77  61 6e 74 20 74 6f 20 61  |es you want to a|
00000810  69 6d 20 66 6f 72 2e 20  0a 41 6c 6c 20 74 68 69  |im for. .All thi|
00000820  73 20 64 6f 65 73 20 69  73 20 63 61 75 73 65 20  |s does is cause |
00000830  74 68 65 20 70 72 6f 67  72 61 6d 20 74 6f 20 70  |the program to p|
00000840  61 75 73 65 20 61 66 74  65 72 20 74 68 61 74 20  |ause after that |
00000850  6d 61 6e 79 20 66 72 61  6d 65 73 2c 20 73 6f 20  |many frames, so |
00000860  79 6f 75 0a 64 6f 6e 27  74 20 6f 76 65 72 73 68  |you.don't oversh|
00000870  6f 6f 74 20 69 66 20 74  68 65 20 63 6f 6d 70 75  |oot if the compu|
00000880  74 65 72 20 69 73 20 62  65 69 6e 67 20 6c 65 66  |ter is being lef|
00000890  74 20 75 6e 61 74 74 65  6e 64 65 64 2e 20 20 49  |t unattended.  I|
000008a0  74 20 61 6c 73 6f 20 73  65 74 73 20 74 68 65 0a  |t also sets the.|
000008b0  6e 75 6d 62 65 72 20 6f  66 20 66 72 61 6d 65 73  |number of frames|
000008c0  20 75 73 65 64 20 74 6f  20 65 73 74 69 6d 61 74  | used to estimat|
000008d0  65 20 74 68 65 20 66 69  6e 69 73 68 69 6e 67 20  |e the finishing |
000008e0  74 69 6d 65 2e 20 20 49  66 20 74 68 65 20 70 72  |time.  If the pr|
000008f0  6f 67 72 61 6d 20 68 61  73 0a 63 6f 6e 74 69 6e  |ogram has.contin|
00000900  75 65 64 20 70 61 73 74  20 74 68 65 20 61 69 6d  |ued past the aim|
00000910  20 70 6f 69 6e 74 2c 20  6f 72 20 74 68 65 72 65  | point, or there|
00000920  20 69 73 20 6e 6f 74 20  65 6e 6f 75 67 68 20 73  | is not enough s|
00000930  70 61 63 65 20 74 6f 20  73 74 6f 72 65 20 74 68  |pace to store th|
00000940  65 0a 6e 75 6d 62 65 72  20 6f 66 20 66 72 61 6d  |e.number of fram|
00000950  65 73 20 61 69 6d 65 64  20 66 6f 72 2c 20 74 68  |es aimed for, th|
00000960  65 20 66 69 6e 69 73 68  69 6e 67 20 74 69 6d 65  |e finishing time|
00000970  20 69 73 20 62 61 73 65  64 20 6f 6e 20 74 68 65  | is based on the|
00000980  20 65 73 74 69 6d 61 74  65 64 0a 6d 61 78 69 6d  | estimated.maxim|
00000990  75 6d 20 6e 75 6d 62 65  72 20 6f 66 20 66 72 61  |um number of fra|
000009a0  6d 65 73 2e 0a 0a 20 20  20 20 20 22 47 72 61 76  |mes...     "Grav|
000009b0  69 74 79 22 20 73 65 74  73 20 74 68 65 20 64 69  |ity" sets the di|
000009c0  72 65 63 74 69 6f 6e 20  61 6e 64 20 73 70 65 65  |rection and spee|
000009d0  64 20 77 69 74 68 20 77  68 69 63 68 20 74 68 69  |d with which thi|
000009e0  6e 67 73 20 66 61 6c 6c  2e 20 20 54 68 65 72 65  |ngs fall.  There|
000009f0  0a 61 72 65 20 74 68 72  65 65 20 6e 75 6d 62 65  |.are three numbe|
00000a00  72 73 20 66 6f 72 20 74  68 65 20 61 6d 6f 75 6e  |rs for the amoun|
00000a10  74 73 20 69 6e 20 74 68  65 20 78 2c 20 79 20 61  |ts in the x, y a|
00000a20  6e 64 20 7a 20 64 69 72  65 63 74 69 6f 6e 73 2e  |nd z directions.|
00000a30  20 20 4e 6f 72 6d 61 6c  6c 79 0a 74 68 65 73 65  |  Normally.these|
00000a40  20 77 69 6c 6c 20 62 65  20 73 6f 6d 65 74 68 69  | will be somethi|
00000a50  6e 67 20 6c 69 6b 65 20  30 2c 20 30 20 20 61 6e  |ng like 0, 0  an|
00000a60  64 20 2d 36 30 30 20 73  6f 20 74 68 69 6e 67 73  |d -600 so things|
00000a70  20 66 61 6c 6c 20 64 6f  77 6e 77 61 72 64 73 2e  | fall downwards.|
00000a80  20 20 54 68 65 0a 73 63  72 69 70 74 20 22 55 70  |  The.script "Up|
00000a90  53 74 61 69 72 73 22 20  75 73 65 73 20 61 20 73  |Stairs" uses a s|
00000aa0  69 64 65 77 61 79 73 20  67 72 61 76 69 74 79 20  |ideways gravity |
00000ab0  74 6f 20 6d 61 6b 65 20  74 68 65 20 63 75 62 65  |to make the cube|
00000ac0  20 61 70 70 65 61 72 20  74 6f 20 63 6c 69 6d 62  | appear to climb|
00000ad0  0a 74 68 65 20 73 74 61  69 72 73 2e 0a 0a 20 20  |.the stairs...  |
00000ae0  20 20 20 54 68 65 20 22  74 69 6d 65 5f 64 69 76  |   The "time_div|
00000af0  22 20 63 6f 6d 6d 61 6e  64 20 73 65 74 73 20 74  |" command sets t|
00000b00  68 65 20 6e 75 6d 62 65  72 20 6f 66 20 74 69 6d  |he number of tim|
00000b10  65 73 20 74 68 65 20 66  69 6e 69 74 65 20 65 6c  |es the finite el|
00000b20  65 6d 65 6e 74 0a 73 69  6d 75 6c 61 74 69 6f 6e  |ement.simulation|
00000b30  20 70 72 6f 63 65 64 75  72 65 73 20 61 72 65 20  | procedures are |
00000b40  63 61 6c 6c 65 64 20 62  65 74 77 65 65 6e 20 66  |called between f|
00000b50  72 61 6d 65 73 2c 20 6f  72 20 69 6e 20 6f 74 68  |rames, or in oth|
00000b60  65 72 20 77 6f 72 64 73  20 68 6f 77 0a 66 69 6e  |er words how.fin|
00000b70  65 6c 79 20 64 69 76 69  64 65 64 20 74 68 65 20  |ely divided the |
00000b80  74 69 6d 65 20 73 74 65  70 73 20 61 72 65 2e 20  |time steps are. |
00000b90  20 54 68 65 20 6e 75 6d  62 65 72 20 6d 75 73 74  | The number must|
00000ba0  20 62 65 20 61 20 70 6f  77 65 72 20 6f 66 20 32  | be a power of 2|
00000bb0  2c 20 65 67 2e 0a 31 2c  32 2c 34 2c 38 20 65 74  |, eg..1,2,4,8 et|
00000bc0  63 2e 20 20 54 68 65 20  6d 61 69 6e 20 70 75 72  |c.  The main pur|
00000bd0  70 6f 73 65 20 6f 66 20  74 68 69 73 20 69 73 20  |pose of this is |
00000be0  74 6f 20 61 6c 6c 6f 77  20 6f 62 6a 65 63 74 73  |to allow objects|
00000bf0  20 74 6f 20 62 65 20 73  74 69 66 66 65 72 0a 77  | to be stiffer.w|
00000c00  69 74 68 6f 75 74 20 65  78 70 6c 6f 64 69 6e 67  |ithout exploding|
00000c10  2c 20 73 6f 20 74 68 65  20 73 70 72 69 6e 67 20  |, so the spring |
00000c20  63 6f 6e 73 74 61 6e 74  73 20 69 6e 20 74 68 65  |constants in the|
00000c30  20 6f 62 6a 65 63 74 73  20 61 72 65 20 61 75 74  | objects are aut|
00000c40  6f 6d 61 74 69 63 61 6c  6c 79 0a 69 6e 63 72 65  |omatically.incre|
00000c50  61 73 65 64 20 77 68 65  6e 20 74 68 69 73 20 76  |ased when this v|
00000c60  61 6c 75 65 20 69 73 20  69 6e 63 72 65 61 73 65  |alue is increase|
00000c70  64 2e 0a 0a 54 48 45 20  52 45 4e 44 45 52 49 4e  |d...THE RENDERIN|
00000c80  47 20 42 4c 4f 43 4b 0a  20 20 20 20 20 54 68 65  |G BLOCK.     The|
00000c90  20 6f 74 68 65 72 20 73  65 74 20 6f 66 20 6f 70  | other set of op|
00000ca0  74 69 6f 6e 73 20 61 66  66 65 63 74 73 20 74 68  |tions affects th|
00000cb0  65 20 61 70 70 65 61 72  61 6e 63 65 20 6f 66 20  |e appearance of |
00000cc0  74 68 65 20 70 69 63 74  75 72 65 20 6f 6e 20 74  |the picture on t|
00000cd0  68 65 0a 73 63 72 65 65  6e 2e 20 20 54 68 69 73  |he.screen.  This|
00000ce0  20 69 73 20 63 61 6c 6c  65 64 20 74 68 65 20 22  | is called the "|
00000cf0  72 65 6e 64 65 72 69 6e  67 20 62 6c 6f 63 6b 22  |rendering block"|
00000d00  20 61 6e 64 20 6c 6f 6f  6b 73 20 6c 69 6b 65 20  | and looks like |
00000d10  74 68 69 73 3a 0a 20 0a  20 20 20 20 20 20 20 20  |this:. .        |
00000d20  20 20 72 65 6e 64 65 72  69 6e 67 20 7b 0a 20 20  |  rendering {.  |
00000d30  20 20 20 20 20 20 20 20  20 74 79 70 65 20 3c 72  |         type <r|
00000d40  65 6e 64 65 72 5f 74 79  70 65 3e 0a 20 20 20 20  |ender_type>.    |
00000d50  20 20 20 20 20 20 20 72  65 73 6f 6c 75 74 69 6f  |       resolutio|
00000d60  6e 20 3c 6e 75 6d 62 65  72 3e 2c 3c 6e 75 6d 62  |n <number>,<numb|
00000d70  65 72 3e 0a 20 20 20 20  20 20 20 20 20 20 20 76  |er>.           v|
00000d80  69 65 77 20 3c 6e 75 6d  62 65 72 3e 2c 3c 6e 75  |iew <number>,<nu|
00000d90  6d 62 65 72 3e 0a 20 20  20 20 20 20 20 20 20 20  |mber>.          |
00000da0  20 62 61 63 6b 67 72 6f  75 6e 64 20 3c 62 61 63  | background <bac|
00000db0  6b 5f 74 79 70 65 3e 0a  20 20 20 20 20 20 20 20  |k_type>.        |
00000dc0  20 20 7d 0a 0a 20 20 20  20 20 3c 72 65 6e 64 65  |  }..     <rende|
00000dd0  72 5f 74 79 70 65 3e 20  69 73 20 6f 6e 65 20 6f  |r_type> is one o|
00000de0  66 20 22 64 6f 74 73 22  2c 20 22 6c 69 6e 65 73  |f "dots", "lines|
00000df0  22 2c 20 22 61 6c 6c 5f  64 6f 74 73 22 20 6f 72  |", "all_dots" or|
00000e00  20 22 77 69 72 65 66 72  61 6d 65 22 2e 20 0a 22  | "wireframe". ."|
00000e10  44 6f 74 73 22 20 64 72  61 77 73 20 74 68 65 20  |Dots" draws the |
00000e20  70 6f 69 6e 74 73 20 61  74 20 74 68 65 20 63 6f  |points at the co|
00000e30  72 6e 65 72 73 20 6f 66  20 74 68 65 20 73 75 72  |rners of the sur|
00000e40  66 61 63 65 20 66 61 63  65 74 73 2c 20 61 6e 64  |face facets, and|
00000e50  20 22 6c 69 6e 65 73 22  0a 64 72 61 77 73 20 74  | "lines".draws t|
00000e60  68 65 20 65 64 67 65 73  20 6f 66 20 74 68 65 20  |he edges of the |
00000e70  73 75 72 66 61 63 65 20  66 61 63 65 74 73 2e 20  |surface facets. |
00000e80  20 54 68 65 20 6f 74 68  65 72 20 74 77 6f 20 6f  | The other two o|
00000e90  70 74 69 6f 6e 73 20 64  6f 20 74 68 65 20 73 61  |ptions do the sa|
00000ea0  6d 65 0a 62 75 74 20 77  69 74 68 6f 75 74 20 72  |me.but without r|
00000eb0  65 6d 6f 76 69 6e 67 20  68 69 64 64 65 6e 20 73  |emoving hidden s|
00000ec0  75 72 66 61 63 65 73 2e  20 20 54 68 65 20 22 64  |urfaces.  The "d|
00000ed0  6f 74 73 22 20 6f 70 74  69 6f 6e 20 75 73 65 73  |ots" option uses|
00000ee0  20 74 68 65 20 6c 65 61  73 74 0a 6d 65 6d 6f 72  | the least.memor|
00000ef0  79 20 66 6f 72 20 66 72  61 6d 65 20 73 74 6f 72  |y for frame stor|
00000f00  61 67 65 2c 20 61 6e 64  20 22 61 6c 6c 5f 64 6f  |age, and "all_do|
00000f10  74 73 22 20 69 73 20 74  68 65 20 71 75 69 63 6b  |ts" is the quick|
00000f20  65 73 74 20 74 6f 20 64  72 61 77 2e 0a 0a 20 20  |est to draw...  |
00000f30  20 20 20 54 68 65 20 22  72 65 73 6f 6c 75 74 69  |   The "resoluti|
00000f40  6f 6e 22 20 63 6f 6d 6d  61 6e 64 20 6c 65 74 73  |on" command lets|
00000f50  20 79 6f 75 20 63 68 6f  6f 73 65 20 74 68 65 20  | you choose the |
00000f60  73 63 72 65 65 6e 20 72  65 73 6f 6c 75 74 69 6f  |screen resolutio|
00000f70  6e 20 79 6f 75 20 77 61  6e 74 0a 74 6f 20 75 73  |n you want.to us|
00000f80  65 2c 20 62 79 20 73 70  65 63 69 66 79 69 6e 67  |e, by specifying|
00000f90  20 74 68 65 20 6e 75 6d  62 65 72 20 6f 66 20 68  | the number of h|
00000fa0  6f 72 69 7a 6f 6e 74 61  6c 20 61 6e 64 20 76 65  |orizontal and ve|
00000fb0  72 74 69 63 61 6c 20 70  69 78 65 6c 73 2e 20 20  |rtical pixels.  |
00000fc0  55 73 65 66 75 6c 0a 76  61 6c 75 65 73 20 61 72  |Useful.values ar|
00000fd0  65 20 33 32 30 2c 32 35  36 20 28 6c 6f 77 20 72  |e 320,256 (low r|
00000fe0  65 73 6f 6c 75 74 69 6f  6e 29 20 36 34 30 2c 32  |esolution) 640,2|
00000ff0  35 36 20 28 68 69 67 68  20 72 65 73 6f 6c 75 74  |56 (high resolut|
00001000  69 6f 6e 29 20 61 6e 64  20 36 34 30 2c 35 31 32  |ion) and 640,512|
00001010  0a 28 6d 75 6c 74 69 73  79 6e 63 20 6d 6f 6e 69  |.(multisync moni|
00001020  74 6f 72 73 29 2c 20 62  75 74 20 79 6f 75 20 63  |tors), but you c|
00001030  61 6e 20 75 73 65 20 61  6e 79 20 72 65 73 6f 6c  |an use any resol|
00001040  75 74 69 6f 6e 20 66 6f  72 20 77 68 69 63 68 20  |ution for which |
00001050  74 68 65 72 65 20 69 73  20 61 0a 73 63 72 65 65  |there is a.scree|
00001060  6e 20 6d 6f 64 65 2e 20  20 54 68 65 20 70 72 6f  |n mode.  The pro|
00001070  67 72 61 6d 20 77 69 6c  6c 20 67 69 76 65 20 61  |gram will give a|
00001080  6e 20 65 72 72 6f 72 20  6f 66 20 74 68 65 72 65  |n error of there|
00001090  20 69 73 20 6e 6f 20 6d  6f 64 65 20 77 68 69 63  | is no mode whic|
000010a0  68 20 66 69 74 73 2e 20  0a 57 68 65 6e 20 63 68  |h fits. .When ch|
000010b0  6f 6f 73 69 6e 67 20 61  20 72 65 73 6f 6c 75 74  |oosing a resolut|
000010c0  69 6f 6e 2c 20 62 65 61  72 20 69 6e 20 6d 69 6e  |ion, bear in min|
000010d0  64 20 74 68 61 74 20 68  69 67 68 65 72 20 72 65  |d that higher re|
000010e0  73 6f 6c 75 74 69 6f 6e  73 20 77 69 6c 6c 20 74  |solutions will t|
000010f0  61 6b 65 0a 6d 6f 72 65  20 66 72 61 6d 65 20 73  |ake.more frame s|
00001100  74 6f 72 61 67 65 20 73  70 61 63 65 2e 0a 0a 20  |torage space... |
00001110  20 20 20 20 22 56 69 65  77 22 20 73 70 65 63 69  |    "View" speci|
00001120  66 69 65 73 20 74 68 65  20 61 6e 67 6c 65 20 66  |fies the angle f|
00001130  72 6f 6d 20 77 68 69 63  68 20 79 6f 75 20 6c 6f  |rom which you lo|
00001140  6f 6b 20 61 74 20 74 68  65 20 73 63 65 6e 65 2e  |ok at the scene.|
00001150  20 20 54 68 65 0a 6e 75  6d 62 65 72 73 20 61 72  |  The.numbers ar|
00001160  65 20 61 6e 67 6c 65 73  20 69 6e 20 64 65 67 72  |e angles in degr|
00001170  65 65 73 2c 20 74 68 65  20 66 69 72 73 74 20 62  |ees, the first b|
00001180  65 69 6e 67 20 74 68 65  20 64 69 72 65 63 74 69  |eing the directi|
00001190  6f 6e 20 69 6e 20 74 68  65 20 78 2d 79 0a 70 6c  |on in the x-y.pl|
000011a0  61 6e 65 2e 20 20 54 68  69 73 20 69 73 20 74 68  |ane.  This is th|
000011b0  65 20 61 6e 67 6c 65 20  74 68 72 6f 75 67 68 20  |e angle through |
000011c0  77 68 69 63 68 20 74 68  65 20 73 63 65 6e 65 20  |which the scene |
000011d0  69 73 20 72 6f 74 61 74  65 64 20 61 62 6f 75 74  |is rotated about|
000011e0  20 74 68 65 0a 76 65 72  74 69 63 61 6c 20 61 78  | the.vertical ax|
000011f0  69 73 2e 20 20 49 66 20  74 68 69 73 20 69 73 20  |is.  If this is |
00001200  30 2c 20 74 68 65 20 78  20 64 69 72 65 63 74 69  |0, the x directi|
00001210  6f 6e 20 69 73 20 68 6f  72 69 7a 6f 6e 74 61 6c  |on is horizontal|
00001220  6c 79 20 61 63 72 6f 73  73 20 79 6f 75 72 0a 73  |ly across your.s|
00001230  63 72 65 65 6e 20 28 2b  78 20 6f 6e 20 74 68 65  |creen (+x on the|
00001240  20 72 69 67 68 74 2c 20  2d 79 20 6f 6e 20 74 68  | right, -y on th|
00001250  65 20 6c 65 66 74 29 20  61 6e 64 20 74 68 65 20  |e left) and the |
00001260  2b 79 20 64 69 72 65 63  74 69 6f 6e 20 69 73 20  |+y direction is |
00001270  6f 75 74 20 6f 66 20 74  68 65 0a 73 63 72 65 65  |out of the.scree|
00001280  6e 20 74 6f 77 61 72 64  73 20 79 6f 75 2e 20 20  |n towards you.  |
00001290  54 68 65 20 73 65 63 6f  6e 64 20 6e 75 6d 62 65  |The second numbe|
000012a0  72 20 69 73 20 74 68 65  20 22 65 6c 65 76 61 74  |r is the "elevat|
000012b0  69 6f 6e 22 3a 20 61 6e  20 76 61 6c 75 65 20 6f  |ion": an value o|
000012c0  66 20 7a 65 72 6f 0a 77  69 6c 6c 20 70 75 74 20  |f zero.will put |
000012d0  74 68 65 20 76 69 65 77  70 6f 69 6e 74 20 6f 6e  |the viewpoint on|
000012e0  20 74 68 65 20 78 2d 79  20 70 6c 61 6e 65 20 28  | the x-y plane (|
000012f0  6c 6f 6f 6b 69 6e 67 20  68 6f 72 69 7a 6f 6e 74  |looking horizont|
00001300  61 6c 6c 79 2c 20 2b 7a  20 61 78 69 73 0a 76 65  |ally, +z axis.ve|
00001310  72 74 69 63 61 6c 6c 79  20 75 70 77 61 72 64 73  |rtically upwards|
00001320  29 2c 20 61 6e 64 20 61  6e 20 61 6e 67 6c 65 20  |), and an angle |
00001330  6f 66 20 39 30 20 77 6f  75 6c 64 20 68 61 76 65  |of 90 would have|
00001340  20 79 6f 75 20 6c 6f 6f  6b 69 6e 67 20 64 69 72  | you looking dir|
00001350  65 63 74 6c 79 20 64 6f  77 6e 0a 66 72 6f 6d 20  |ectly down.from |
00001360  61 62 6f 76 65 2e 0a 0a  20 20 20 20 20 54 68 65  |above...     The|
00001370  20 22 62 61 63 6b 67 72  6f 75 6e 64 22 20 63 6f  | "background" co|
00001380  6d 6d 61 6e 64 20 69 73  20 6f 70 74 69 6f 6e 61  |mmand is optiona|
00001390  6c 3a 20 69 66 20 79 6f  75 20 69 6e 63 6c 75 64  |l: if you includ|
000013a0  65 20 22 62 61 63 6b 67  72 6f 75 6e 64 20 62 61  |e "background ba|
000013b0  63 6b 22 0a 69 6e 20 74  68 65 20 72 65 6e 64 65  |ck".in the rende|
000013c0  72 69 6e 67 20 62 6c 6f  63 6b 2c 20 74 68 65 20  |ring block, the |
000013d0  70 72 6f 67 72 61 6d 20  61 73 73 75 6d 65 73 20  |program assumes |
000013e0  74 68 61 74 20 74 68 65  20 62 61 63 6b 67 72 6f  |that the backgro|
000013f0  75 6e 64 20 6f 62 6a 65  63 74 28 73 29 0a 61 72  |und object(s).ar|
00001400  65 20 61 6c 77 61 79 73  20 62 65 68 69 6e 64 20  |e always behind |
00001410  74 68 65 20 73 6f 6c 69  64 20 6f 62 6a 65 63 74  |the solid object|
00001420  28 73 29 2c 20 61 6e 64  20 64 6f 65 73 20 6e 6f  |(s), and does no|
00001430  74 20 72 65 64 72 61 77  20 74 68 65 20 62 61 63  |t redraw the bac|
00001440  6b 67 72 6f 75 6e 64 0a  65 76 65 72 79 20 66 72  |kground.every fr|
00001450  61 6d 65 2e 20 20 54 68  69 73 20 69 73 20 75 73  |ame.  This is us|
00001460  65 66 75 6c 2c 20 66 6f  72 20 65 78 61 6d 70 6c  |eful, for exampl|
00001470  65 2c 20 77 68 65 6e 20  74 68 65 20 62 61 63 6b  |e, when the back|
00001480  67 72 6f 75 6e 64 20 69  73 20 61 20 73 65 74 20  |ground is a set |
00001490  6f 66 0a 73 74 61 69 72  73 2c 20 61 73 20 69 74  |of.stairs, as it|
000014a0  20 72 65 64 75 63 65 73  20 74 68 65 20 66 72 61  | reduces the fra|
000014b0  6d 65 20 64 72 61 77 69  6e 67 20 74 69 6d 65 2e  |me drawing time.|
000014c0  20 20 54 68 65 20 64 65  66 61 75 6c 74 20 73 65  |  The default se|
000014d0  74 74 69 6e 67 20 69 73  0a 22 62 61 63 6b 67 72  |tting is."backgr|
000014e0  6f 75 6e 64 20 6d 69 78  22 20 77 68 69 63 68 20  |ound mix" which |
000014f0  6c 65 74 73 20 74 68 65  20 62 61 63 6b 67 72 6f  |lets the backgro|
00001500  75 6e 64 20 6f 62 6a 65  63 74 28 73 29 20 62 65  |und object(s) be|
00001510  20 70 61 72 74 6c 79 20  69 6e 20 66 72 6f 6e 74  | partly in front|
00001520  20 6f 66 0a 61 6e 64 20  70 61 72 74 6c 79 20 62  | of.and partly b|
00001530  65 68 69 6e 64 20 74 68  65 20 73 6f 6c 69 64 28  |ehind the solid(|
00001540  73 29 2e 0a 0a 20 20 20  20 20 54 68 65 20 6f 72  |s)...     The or|
00001550  64 65 72 20 69 6e 20 77  68 69 63 68 20 61 6e 79  |der in which any|
00001560  20 6f 66 20 74 68 65 20  61 62 6f 76 65 20 6f 70  | of the above op|
00001570  74 69 6f 6e 73 20 61 72  65 20 61 72 72 61 6e 67  |tions are arrang|
00001580  65 64 20 64 6f 65 73 20  6e 6f 74 0a 6d 61 74 74  |ed does not.matt|
00001590  65 72 2c 20 61 73 20 6c  6f 6e 67 20 61 73 20 74  |er, as long as t|
000015a0  68 65 20 72 65 6e 64 65  72 69 6e 67 20 6f 70 74  |he rendering opt|
000015b0  69 6f 6e 73 20 61 72 65  20 6b 65 70 74 20 69 6e  |ions are kept in|
000015c0  73 69 64 65 20 74 68 65  20 72 65 6e 64 65 72 69  |side the renderi|
000015d0  6e 67 0a 62 6c 6f 63 6b  2e 0a 0a 20 20 20 20 20  |ng.block...     |
000015e0  43 52 45 41 54 49 4e 47  20 4f 42 4a 45 43 54 53  |CREATING OBJECTS|
000015f0  3a 20 42 41 43 4b 47 52  4f 55 4e 44 20 4f 42 4a  |: BACKGROUND OBJ|
00001600  45 43 54 53 0a 20 20 20  20 20 42 61 63 6b 67 72  |ECTS.     Backgr|
00001610  6f 75 6e 64 20 6f 62 6a  65 63 74 73 20 61 72 65  |ound objects are|
00001620  20 74 68 65 20 66 69 78  65 64 20 70 69 65 63 65  | the fixed piece|
00001630  73 20 6f 66 20 73 63 65  6e 65 72 79 20 77 68 69  |s of scenery whi|
00001640  63 68 20 74 68 65 20 6d  6f 76 69 6e 67 0a 6f 62  |ch the moving.ob|
00001650  6a 65 63 74 73 20 69 6e  74 65 72 61 63 74 20 77  |jects interact w|
00001660  69 74 68 2e 20 20 59 6f  75 20 63 61 6e 20 68 61  |ith.  You can ha|
00001670  76 65 20 61 73 20 6d 61  6e 79 20 62 61 63 6b 67  |ve as many backg|
00001680  72 6f 75 6e 64 20 6f 62  6a 65 63 74 73 20 61 73  |round objects as|
00001690  20 79 6f 75 20 77 61 6e  74 3a 0a 74 68 65 79 20  | you want:.they |
000016a0  61 72 65 20 61 6c 6c 20  63 72 65 61 74 65 64 20  |are all created |
000016b0  61 74 20 74 68 65 20 6f  72 69 67 69 6e 20 62 75  |at the origin bu|
000016c0  74 20 74 68 65 79 20 63  61 6e 20 62 65 20 6d 6f  |t they can be mo|
000016d0  76 65 64 20 74 6f 20 61  6e 79 20 70 6f 73 69 74  |ved to any posit|
000016e0  69 6f 6e 2e 0a 20 20 20  20 20 54 68 65 20 73 63  |ion..     The sc|
000016f0  72 69 70 74 20 74 6f 20  63 72 65 61 74 65 20 61  |ript to create a|
00001700  20 62 61 63 6b 67 72 6f  75 6e 64 20 6f 62 6a 65  | background obje|
00001710  63 74 20 69 73 20 61 73  20 66 6f 6c 6c 6f 77 73  |ct is as follows|
00001720  3a 0a 20 20 20 20 20 20  20 20 20 20 62 61 63 6b  |:.          back|
00001730  67 72 6f 75 6e 64 20 7b  0a 20 20 20 20 20 20 20  |ground {.       |
00001740  20 20 20 20 63 72 65 61  74 65 20 7b 0a 20 20 20  |    create {.   |
00001750  20 20 20 20 20 20 20 20  20 74 79 70 65 20 3c 6f  |         type <o|
00001760  62 6a 65 63 74 5f 74 79  70 65 3e 0a 20 20 20 20  |bject_type>.    |
00001770  20 20 20 20 20 20 20 20  70 6f 69 6e 74 73 20 3c  |        points <|
00001780  70 6f 69 6e 74 73 5f 73  70 65 63 3e 0a 20 20 20  |points_spec>.   |
00001790  20 20 20 20 20 20 20 20  20 73 69 7a 65 20 3c 73  |         size <s|
000017a0  69 7a 65 5f 73 70 65 63  3e 0a 20 20 20 20 20 20  |ize_spec>.      |
000017b0  20 20 20 20 20 7d 0a 20  20 20 20 20 20 20 20 20  |     }.         |
000017c0  20 20 74 72 61 6e 73 6c  61 74 65 20 3c 78 3e 2c  |  translate <x>,|
000017d0  3c 79 3e 2c 3c 7a 3e 0a  20 20 20 20 20 20 20 20  |<y>,<z>.        |
000017e0  20 20 7d 0a 20 20 20 20  20 54 68 65 20 69 6e 64  |  }.     The ind|
000017f0  65 6e 74 61 74 69 6f 6e  20 69 73 20 6f 70 74 69  |entation is opti|
00001800  6f 6e 61 6c 3a 20 69 74  20 77 61 73 20 61 64 64  |onal: it was add|
00001810  65 64 20 66 6f 72 20 63  6c 61 72 69 74 79 2e 20  |ed for clarity. |
00001820  20 54 68 65 20 66 69 72  73 74 20 74 68 69 6e 67  | The first thing|
00001830  0a 69 6e 20 61 20 62 61  63 6b 67 72 6f 75 6e 64  |.in a background|
00001840  20 62 6c 6f 63 6b 20 6d  75 73 74 20 62 65 20 61  | block must be a|
00001850  20 63 72 65 61 74 65 20  62 6c 6f 63 6b 2c 20 61  | create block, a|
00001860  6e 64 20 74 68 65 72 65  20 6d 75 73 74 20 62 65  |nd there must be|
00001870  20 6f 6e 6c 79 20 6f 6e  65 20 6f 66 0a 74 68 65  | only one of.the|
00001880  73 65 2e 20 20 54 68 65  20 74 72 61 6e 73 6c 61  |se.  The transla|
00001890  74 65 20 63 6f 6d 6d 61  6e 64 20 69 73 20 6f 70  |te command is op|
000018a0  74 69 6f 6e 61 6c 2c 20  61 6e 64 20 74 68 65 72  |tional, and ther|
000018b0  65 20 6d 61 79 20 62 65  20 61 6e 79 20 6e 75 6d  |e may be any num|
000018c0  62 65 72 20 6f 66 0a 74  68 65 73 65 2e 20 20 54  |ber of.these.  T|
000018d0  68 65 20 74 68 72 65 65  20 70 61 72 61 6d 65 74  |he three paramet|
000018e0  65 72 73 20 61 72 65 20  74 68 65 20 61 6d 6f 75  |ers are the amou|
000018f0  6e 74 73 20 62 79 20 77  68 69 63 68 20 74 6f 20  |nts by which to |
00001900  6d 6f 76 65 20 74 68 65  20 6f 62 6a 65 63 74 20  |move the object |
00001910  69 6e 0a 74 68 65 20 78  2c 20 79 20 61 6e 64 20  |in.the x, y and |
00001920  7a 20 64 69 72 65 63 74  69 6f 6e 73 2e 20 20 41  |z directions.  A|
00001930  6c 6c 20 64 69 73 74 61  6e 63 65 73 20 73 68 6f  |ll distances sho|
00001940  75 6c 64 20 62 65 20 66  6f 6c 6c 6f 77 65 64 20  |uld be followed |
00001950  62 79 20 61 20 75 6e 69  74 2c 20 65 67 0a 33 2e  |by a unit, eg.3.|
00001960  33 69 6e 20 28 77 69 74  68 20 6e 6f 20 73 65 70  |3in (with no sep|
00001970  61 72 61 74 69 6e 67 20  73 70 61 63 65 29 2e 20  |arating space). |
00001980  20 55 6e 69 74 73 20 72  65 63 6f 67 6e 69 7a 65  | Units recognize|
00001990  64 20 61 72 65 20 69 6e  2c 20 66 74 2c 20 63 6d  |d are in, ft, cm|
000019a0  20 61 6e 64 20 6d 6d 2e  20 0a 54 68 65 20 64 65  | and mm. .The de|
000019b0  66 61 75 6c 74 20 75 6e  69 74 20 69 73 20 31 2f  |fault unit is 1/|
000019c0  36 34 30 20 6f 66 20 61  20 70 72 69 6e 74 65 72  |640 of a printer|
000019d0  27 73 20 70 6f 69 6e 74  20 28 61 20 76 65 72 79  |'s point (a very|
000019e0  20 73 6d 61 6c 6c 20 64  69 73 74 61 6e 63 65 29  | small distance)|
000019f0  2c 20 73 6f 0a 69 66 20  74 68 65 20 74 72 61 6e  |, so.if the tran|
00001a00  73 6c 61 74 65 20 63 6f  6d 6d 61 6e 64 20 68 61  |slate command ha|
00001a10  73 20 6e 6f 20 76 69 73  69 62 6c 65 20 65 66 66  |s no visible eff|
00001a20  65 63 74 2c 20 63 68 65  63 6b 20 74 68 65 20 75  |ect, check the u|
00001a30  6e 69 74 73 2e 0a 20 20  20 20 20 54 68 65 20 66  |nits..     The f|
00001a40  69 72 73 74 20 77 6f 72  64 20 69 6e 20 74 68 65  |irst word in the|
00001a50  20 63 72 65 61 74 65 20  62 6c 6f 63 6b 20 6d 75  | create block mu|
00001a60  73 74 20 62 65 20 22 74  79 70 65 22 2c 20 62 65  |st be "type", be|
00001a70  63 61 75 73 65 20 74 68  65 20 65 66 66 65 63 74  |cause the effect|
00001a80  0a 6f 66 20 74 68 65 20  22 70 6f 69 6e 74 73 22  |.of the "points"|
00001a90  20 61 6e 64 20 22 73 69  7a 65 22 20 63 6f 6d 6d  | and "size" comm|
00001aa0  61 6e 64 73 20 61 72 65  20 64 65 70 65 6e 64 61  |ands are dependa|
00001ab0  6e 74 20 6f 6e 20 74 68  65 20 6f 62 6a 65 63 74  |nt on the object|
00001ac0  20 74 79 70 65 2e 20 20  46 6f 72 20 61 0a 62 61  | type.  For a.ba|
00001ad0  63 6b 67 72 6f 75 6e 64  20 6f 62 6a 65 63 74 2c  |ckground object,|
00001ae0  20 3c 6f 62 6a 65 63 74  5f 74 79 70 65 3e 20 6d  | <object_type> m|
00001af0  75 73 74 20 62 65 20 6f  6e 65 20 6f 66 20 22 73  |ust be one of "s|
00001b00  68 65 65 74 22 2c 20 22  73 70 68 65 72 65 22 20  |heet", "sphere" |
00001b10  6f 72 0a 22 73 74 61 69  72 73 22 2e 0a 0a 54 48  |or."stairs"...TH|
00001b20  45 20 53 50 48 45 52 45  20 4f 42 4a 45 43 54 0a  |E SPHERE OBJECT.|
00001b30  20 20 20 20 20 54 68 69  73 20 68 61 73 20 6f 6e  |     This has on|
00001b40  65 20 22 70 6f 69 6e 74  73 22 20 70 61 72 61 6d  |e "points" param|
00001b50  65 74 65 72 20 61 6e 64  20 6f 6e 65 20 22 73 69  |eter and one "si|
00001b60  7a 65 22 20 70 61 72 61  6d 65 74 65 72 2c 20 69  |ze" parameter, i|
00001b70  2e 65 2e 20 74 68 65 20  77 6f 72 64 0a 22 70 6f  |.e. the word."po|
00001b80  69 6e 74 73 22 20 6d 75  73 74 20 62 65 20 66 6f  |ints" must be fo|
00001b90  6c 6c 6f 77 65 64 20 62  79 20 6f 6e 65 20 6e 75  |llowed by one nu|
00001ba0  6d 62 65 72 2c 20 61 6e  64 20 22 73 69 7a 65 22  |mber, and "size"|
00001bb0  20 6d 75 73 74 20 62 65  20 66 6f 6c 6c 6f 77 65  | must be followe|
00001bc0  64 20 62 79 20 61 0a 64  69 73 74 61 6e 63 65 2e  |d by a.distance.|
00001bd0  20 20 54 68 65 20 70 72  65 76 69 6f 75 73 20 72  |  The previous r|
00001be0  65 6d 61 72 6b 73 20 61  62 6f 75 74 20 75 6e 69  |emarks about uni|
00001bf0  74 73 20 66 6f 72 20 64  69 73 74 61 6e 63 65 73  |ts for distances|
00001c00  20 61 6c 73 6f 20 61 70  70 6c 79 20 74 6f 20 61  | also apply to a|
00001c10  6c 6c 0a 73 69 7a 65 20  70 61 72 61 6d 65 74 65  |ll.size paramete|
00001c20  72 73 2e 20 20 54 68 65  20 73 69 7a 65 20 70 61  |rs.  The size pa|
00001c30  72 61 6d 65 74 65 72 20  66 6f 72 20 61 20 73 70  |rameter for a sp|
00001c40  68 65 72 65 20 73 65 74  73 20 69 74 73 20 72 61  |here sets its ra|
00001c50  64 69 75 73 2e 20 20 54  68 65 0a 70 6f 69 6e 74  |dius.  The.point|
00001c60  73 20 70 61 72 61 6d 65  74 65 72 20 73 65 74 73  |s parameter sets|
00001c70  20 74 68 65 20 6e 75 6d  62 65 72 20 6f 66 20 70  | the number of p|
00001c80  6f 69 6e 74 73 20 75 73  65 64 20 74 6f 20 64 72  |oints used to dr|
00001c90  61 77 20 74 68 65 20 73  70 68 65 72 65 3a 20 69  |aw the sphere: i|
00001ca0  66 20 74 68 69 73 0a 70  61 72 61 6d 65 74 65 72  |f this.parameter|
00001cb0  20 69 73 20 50 2c 20 74  68 65 20 6e 75 6d 62 65  | is P, the numbe|
00001cc0  72 20 6f 66 20 70 6f 69  6e 74 73 20 75 73 65 64  |r of points used|
00001cd0  20 69 73 20 32 20 78 20  50 20 78 20 50 2e 20 20  | is 2 x P x P.  |
00001ce0  54 68 65 72 65 20 61 72  65 20 50 20 72 69 6e 67  |There are P ring|
00001cf0  73 0a 6f 66 20 70 6f 69  6e 74 73 2c 20 65 61 63  |s.of points, eac|
00001d00  68 20 63 6f 6e 74 61 69  6e 69 6e 67 20 32 50 20  |h containing 2P |
00001d10  70 6f 69 6e 74 73 2e 20  20 31 32 20 69 73 20 61  |points.  12 is a|
00001d20  6e 20 61 64 65 71 75 61  74 65 20 76 61 6c 75 65  |n adequate value|
00001d30  20 66 6f 72 20 74 68 69  73 0a 70 61 72 61 6d 65  | for this.parame|
00001d40  74 65 72 2e 0a 20 20 20  20 20 59 6f 75 20 73 68  |ter..     You sh|
00001d50  6f 75 6c 64 20 61 76 6f  69 64 20 63 72 65 61 74  |ould avoid creat|
00001d60  69 6e 67 20 6f 62 6a 65  63 74 73 20 77 68 69 63  |ing objects whic|
00001d70  68 20 65 78 74 65 6e 64  20 69 6e 74 6f 20 61 20  |h extend into a |
00001d80  73 70 68 65 72 65 2c 20  62 65 63 61 75 73 65 0a  |sphere, because.|
00001d90  74 68 65 73 65 20 77 69  6c 6c 20 62 65 20 65 6a  |these will be ej|
00001da0  65 63 74 65 64 20 6f 75  74 77 61 72 64 73 20 76  |ected outwards v|
00001db0  69 6f 6c 65 6e 74 6c 79  2e 0a 0a 54 48 45 20 53  |iolently...THE S|
00001dc0  48 45 45 54 20 4f 42 4a  45 43 54 0a 20 20 20 20  |HEET OBJECT.    |
00001dd0  20 54 68 69 73 20 68 61  73 20 6f 6e 65 20 22 70  | This has one "p|
00001de0  6f 69 6e 74 73 22 20 70  61 72 61 6d 65 74 65 72  |oints" parameter|
00001df0  20 61 6e 64 20 6f 6e 65  20 22 73 69 7a 65 22 20  | and one "size" |
00001e00  70 61 72 61 6d 65 74 65  72 2e 20 20 53 68 65 65  |parameter.  Shee|
00001e10  74 73 20 61 72 65 0a 61  6c 77 61 79 73 20 73 71  |ts are.always sq|
00001e20  75 61 72 65 3a 20 74 68  65 20 70 6f 69 6e 74 73  |uare: the points|
00001e30  20 70 61 72 61 6d 65 74  65 72 20 73 65 74 73 20  | parameter sets |
00001e40  74 68 65 20 6e 75 6d 62  65 72 20 6f 66 20 70 6f  |the number of po|
00001e50  69 6e 74 73 20 61 6c 6f  6e 67 20 6f 6e 65 0a 73  |ints along one.s|
00001e60  69 64 65 2c 20 61 6e 64  20 74 68 65 20 73 69 7a  |ide, and the siz|
00001e70  65 20 70 61 72 61 6d 65  74 65 72 20 73 65 74 73  |e parameter sets|
00001e80  20 74 68 65 20 6c 65 6e  67 74 68 20 6f 66 20 6f  | the length of o|
00001e90  6e 65 20 73 69 64 65 2e  20 20 46 6f 72 20 65 78  |ne side.  For ex|
00001ea0  61 6d 70 6c 65 2c 20 69  66 0a 79 6f 75 20 75 73  |ample, if.you us|
00001eb0  65 20 22 70 6f 69 6e 74  73 20 32 31 22 20 61 6e  |e "points 21" an|
00001ec0  64 20 22 73 69 7a 65 20  35 69 6e 22 20 74 68 65  |d "size 5in" the|
00001ed0  20 70 72 6f 67 72 61 6d  20 77 69 6c 6c 20 63 72  | program will cr|
00001ee0  65 61 74 65 20 61 20 73  68 65 65 74 20 77 69 74  |eate a sheet wit|
00001ef0  68 20 32 31 20 78 0a 32  31 20 3d 20 34 34 31 20  |h 21 x.21 = 441 |
00001f00  70 6f 69 6e 74 73 2c 20  73 6f 20 69 66 20 79 6f  |points, so if yo|
00001f10  75 20 75 73 65 20 22 6c  69 6e 65 73 22 20 61 73  |u use "lines" as|
00001f20  20 74 68 65 20 72 65 6e  64 65 72 69 6e 67 20 74  | the rendering t|
00001f30  79 70 65 20 74 68 65 20  73 68 65 65 74 20 77 69  |ype the sheet wi|
00001f40  6c 6c 0a 62 65 20 64 69  76 69 64 65 64 20 69 6e  |ll.be divided in|
00001f50  74 6f 20 32 30 20 78 20  32 30 20 73 71 75 61 72  |to 20 x 20 squar|
00001f60  65 73 2c 20 65 61 63 68  20 30 2e 32 35 69 6e 20  |es, each 0.25in |
00001f70  78 20 30 2e 32 35 69 6e  2e 20 20 54 68 65 20 73  |x 0.25in.  The s|
00001f80  68 65 65 74 20 69 73 20  63 72 65 61 74 65 64 0a  |heet is created.|
00001f90  68 6f 72 69 7a 6f 6e 74  61 6c 20 28 69 65 2e 20  |horizontal (ie. |
00001fa0  6f 6e 20 74 68 65 20 78  2d 79 20 70 6c 61 6e 65  |on the x-y plane|
00001fb0  29 20 61 6e 64 20 63 65  6e 74 72 65 64 20 6f 6e  |) and centred on|
00001fc0  20 74 68 65 20 6f 72 69  67 69 6e 2c 20 73 6f 20  | the origin, so |
00001fd0  69 6e 20 74 68 65 20 61  62 6f 76 65 0a 65 78 61  |in the above.exa|
00001fe0  6d 70 6c 65 20 74 68 65  20 73 68 65 65 74 20 77  |mple the sheet w|
00001ff0  6f 75 6c 64 20 65 78 74  65 6e 64 20 66 72 6f 6d  |ould extend from|
00002000  20 2d 35 69 6e 20 74 6f  20 2b 35 69 6e 20 69 6e  | -5in to +5in in|
00002010  20 74 68 65 20 78 20 64  69 72 65 63 74 69 6f 6e  | the x direction|
00002020  2c 20 66 72 6f 6d 0a 2d  35 69 6e 20 74 6f 20 2b  |, from.-5in to +|
00002030  35 69 6e 20 69 6e 20 74  68 65 20 79 20 64 69 72  |5in in the y dir|
00002040  65 63 74 69 6f 6e 2c 20  61 6e 64 20 68 61 76 65  |ection, and have|
00002050  20 7a 3d 30 20 66 6f 72  20 61 6c 6c 20 70 6f 69  | z=0 for all poi|
00002060  6e 74 73 2e 0a 20 20 20  20 20 57 68 65 6e 20 74  |nts..     When t|
00002070  68 65 20 73 68 65 65 74  20 69 73 20 63 72 65 61  |he sheet is crea|
00002080  74 65 64 20 61 73 20 61  20 62 61 63 6b 67 72 6f  |ted as a backgro|
00002090  75 6e 64 20 6f 62 6a 65  63 74 2c 20 69 74 20 64  |und object, it d|
000020a0  65 66 69 6e 65 73 20 61  20 22 66 6c 6f 6f 72 22  |efines a "floor"|
000020b0  2e 20 0a 4e 6f 20 73 6f  6c 69 64 20 77 69 6c 6c  |. .No solid will|
000020c0  20 62 65 20 61 6c 6c 6f  77 65 64 20 74 6f 20 70  | be allowed to p|
000020d0  61 73 73 20 62 65 6c 6f  77 20 74 68 65 20 68 65  |ass below the he|
000020e0  69 67 68 74 20 6f 66 20  74 68 65 20 73 68 65 65  |ight of the shee|
000020f0  74 2e 20 20 59 6f 75 20  73 68 6f 75 6c 64 0a 61  |t.  You should.a|
00002100  76 6f 69 64 20 63 72 65  61 74 69 6e 67 20 6f 62  |void creating ob|
00002110  6a 65 63 74 73 20 77 68  69 63 68 20 65 78 74 65  |jects which exte|
00002120  6e 64 20 62 65 6c 6f 77  20 74 68 65 20 66 6c 6f  |nd below the flo|
00002130  6f 72 2c 20 62 65 63 61  75 73 65 20 74 68 65 73  |or, because thes|
00002140  65 20 77 69 6c 6c 20 62  65 0a 65 6a 65 63 74 65  |e will be.ejecte|
00002150  64 20 75 70 77 61 72 64  73 20 76 69 6f 6c 65 6e  |d upwards violen|
00002160  74 6c 79 2e 20 20 4e 6f  74 65 20 74 68 61 74 20  |tly.  Note that |
00002170  74 68 65 20 66 6c 6f 6f  72 20 65 66 66 65 63 74  |the floor effect|
00002180  20 64 6f 65 73 20 6e 6f  74 20 64 65 70 65 6e 64  | does not depend|
00002190  20 6f 6e 0a 74 68 65 20  73 69 7a 65 20 6f 66 20  | on.the size of |
000021a0  74 68 65 20 73 68 65 65  74 2c 20 6f 6e 6c 79 20  |the sheet, only |
000021b0  6f 6e 20 69 74 73 20 76  65 72 74 69 63 61 6c 20  |on its vertical |
000021c0  70 6f 73 69 74 69 6f 6e  2e 3a 20 74 68 65 20 65  |position.: the e|
000021d0  66 66 65 63 74 69 76 65  20 66 6c 6f 6f 72 0a 69  |ffective floor.i|
000021e0  73 20 61 6e 20 69 6e 66  69 6e 69 74 65 20 70 6c  |s an infinite pl|
000021f0  61 6e 65 20 61 74 20 74  68 65 20 73 61 6d 65 20  |ane at the same |
00002200  68 65 69 67 68 74 20 61  73 20 74 68 65 20 73 68  |height as the sh|
00002210  65 65 74 2e 20 20 49 66  20 79 6f 75 20 77 61 6e  |eet.  If you wan|
00002220  74 65 64 20 61 6e 0a 69  6e 76 69 73 69 62 6c 65  |ted an.invisible|
00002230  20 66 6c 6f 6f 72 2c 20  74 68 65 72 65 66 6f 72  | floor, therefor|
00002240  65 2c 20 79 6f 75 20 63  6f 75 6c 64 20 63 72 65  |e, you could cre|
00002250  61 74 65 20 61 20 73 6d  61 6c 6c 20 73 68 65 65  |ate a small shee|
00002260  74 20 77 69 74 68 20 70  6f 69 6e 74 73 20 73 65  |t with points se|
00002270  74 0a 74 6f 20 32 2c 20  61 6e 64 20 6d 6f 76 65  |t.to 2, and move|
00002280  20 69 74 20 6f 75 74 20  6f 66 20 73 69 67 68 74  | it out of sight|
00002290  20 69 6e 20 74 68 65 20  78 20 6f 72 20 79 20 64  | in the x or y d|
000022a0  69 72 65 63 74 69 6f 6e  2e 0a 0a 54 48 45 20 53  |irection...THE S|
000022b0  54 41 49 52 53 20 4f 42  4a 45 43 54 0a 20 20 20  |TAIRS OBJECT.   |
000022c0  20 20 42 65 69 6e 67 20  61 20 6d 6f 72 65 20 63  |  Being a more c|
000022d0  6f 6d 70 6c 65 78 20 6f  62 6a 65 63 74 2c 20 74  |omplex object, t|
000022e0  68 69 73 20 74 61 6b 65  73 20 74 68 72 65 65 20  |his takes three |
000022f0  70 6f 69 6e 74 73 20 70  61 72 61 6d 65 74 65 72  |points parameter|
00002300  73 20 61 6e 64 0a 74 68  72 65 65 20 73 69 7a 65  |s and.three size|
00002310  20 70 61 72 61 6d 65 74  65 72 73 2e 20 20 4a 75  | parameters.  Ju|
00002320  73 74 20 74 6f 20 63 6f  6e 66 75 73 65 20 74 68  |st to confuse th|
00002330  69 6e 67 73 2c 20 74 68  65 20 70 6f 69 6e 74 73  |ings, the points|
00002340  20 70 61 72 61 6d 65 74  65 72 73 20 64 6f 20 6e  | parameters do n|
00002350  6f 74 0a 63 6f 72 72 65  73 70 6f 6e 64 20 74 6f  |ot.correspond to|
00002360  20 74 68 65 20 73 61 6d  65 20 66 65 61 74 75 72  | the same featur|
00002370  65 73 20 61 73 20 74 68  65 20 73 69 7a 65 20 70  |es as the size p|
00002380  61 72 61 6d 65 74 65 72  73 2c 20 75 6e 6c 69 6b  |arameters, unlik|
00002390  65 20 74 68 65 20 6f 74  68 65 72 0a 6f 62 6a 65  |e the other.obje|
000023a0  63 74 73 2e 20 20 4c 65  74 27 73 20 74 61 6b 65  |cts.  Let's take|
000023b0  20 74 68 65 20 73 69 7a  65 20 70 61 72 61 6d 65  | the size parame|
000023c0  74 65 72 73 20 66 69 72  73 74 3b 20 74 68 65 73  |ters first; thes|
000023d0  65 20 61 72 65 3a 0a 20  20 20 20 20 20 20 20 20  |e are:.         |
000023e0  20 73 69 7a 65 20 3c 73  74 65 70 5f 77 69 64 74  | size <step_widt|
000023f0  68 3e 2c 3c 73 74 65 70  5f 68 65 69 67 68 74 3e  |h>,<step_height>|
00002400  2c 3c 73 74 65 70 5f 64  65 70 74 68 3e 0a 20 20  |,<step_depth>.  |
00002410  20 20 20 54 68 65 73 65  20 61 72 65 20 71 75 69  |   These are qui|
00002420  74 65 20 6f 62 76 69 6f  75 73 3a 20 3c 73 74 65  |te obvious: <ste|
00002430  70 5f 77 69 64 74 68 3e  20 69 73 20 74 68 65 20  |p_width> is the |
00002440  77 69 64 74 68 20 6f 66  20 74 68 65 20 73 74 65  |width of the ste|
00002450  70 73 20 61 6c 6f 6e 67  0a 74 68 65 20 78 20 61  |ps along.the x a|
00002460  78 69 73 20 28 73 65 65  20 64 69 61 67 72 61 6d  |xis (see diagram|
00002470  20 62 65 6c 6f 77 29 2c  20 3c 73 74 65 70 5f 68  | below), <step_h|
00002480  65 69 67 68 74 3e 20 69  73 20 74 68 65 20 61 6d  |eight> is the am|
00002490  6f 75 6e 74 20 79 6f 75  20 77 6f 75 6c 64 20 68  |ount you would h|
000024a0  61 76 65 0a 74 6f 20 6c  69 66 74 20 79 6f 75 72  |ave.to lift your|
000024b0  20 66 65 65 74 20 28 7a  20 64 69 72 65 63 74 69  | feet (z directi|
000024c0  6f 6e 29 20 61 6e 64 20  3c 73 74 65 70 5f 64 65  |on) and <step_de|
000024d0  70 74 68 3e 20 69 73 20  74 68 65 20 61 6d 6f 75  |pth> is the amou|
000024e0  6e 74 20 6f 66 20 72 6f  6f 6d 20 79 6f 75 0a 68  |nt of room you.h|
000024f0  61 76 65 20 66 6f 72 20  79 6f 75 72 20 66 65 65  |ave for your fee|
00002500  74 20 6f 6e 20 65 61 63  68 20 73 74 65 70 20 28  |t on each step (|
00002510  79 20 64 69 72 65 63 74  69 6f 6e 29 2e 0a 20 20  |y direction)..  |
00002520  20 20 20 54 68 65 20 70  6f 69 6e 74 73 20 70 61  |   The points pa|
00002530  72 61 6d 65 74 65 72 73  20 61 72 65 3a 0a 20 20  |rameters are:.  |
00002540  20 20 20 20 20 20 20 20  70 6f 69 6e 74 73 20 3c  |        points <|
00002550  70 74 73 5f 77 69 64 74  68 3e 2c 3c 73 74 65 70  |pts_width>,<step|
00002560  73 3e 2c 3c 70 74 73 5f  64 65 70 74 68 3e 0a 20  |s>,<pts_depth>. |
00002570  20 20 20 20 54 68 65 20  66 69 72 73 74 20 61 6e  |    The first an|
00002580  64 20 74 68 69 72 64 20  6f 66 20 74 68 65 73 65  |d third of these|
00002590  20 6a 75 73 74 20 73 65  74 20 74 68 65 20 6e 75  | just set the nu|
000025a0  6d 62 65 72 20 6f 66 20  70 6f 69 6e 74 73 20 75  |mber of points u|
000025b0  73 65 64 20 74 6f 20 64  72 61 77 0a 74 68 65 20  |sed to draw.the |
000025c0  68 6f 72 69 7a 6f 6e 74  61 6c 20 70 61 72 74 20  |horizontal part |
000025d0  6f 66 20 74 68 65 20 73  74 65 70 73 3a 20 74 68  |of the steps: th|
000025e0  65 20 73 65 63 6f 6e 64  20 69 73 20 75 6e 75 73  |e second is unus|
000025f0  75 61 6c 20 69 6e 20 74  68 61 74 20 69 74 20 63  |ual in that it c|
00002600  68 61 6e 67 65 73 0a 74  68 65 20 73 69 7a 65 20  |hanges.the size |
00002610  6f 66 20 74 68 65 20 6f  62 6a 65 63 74 2c 20 73  |of the object, s|
00002620  69 6e 63 65 20 69 74 20  73 65 74 73 20 74 68 65  |ince it sets the|
00002630  20 6e 75 6d 62 65 72 20  6f 66 20 73 74 65 70 73  | number of steps|
00002640  2e 0a 0a 20 20 20 20 20  20 20 20 20 20 20 20 20  |...             |
00002650  20 20 2b 0a 20 20 20 20  20 20 20 20 20 20 20 20  |  +.            |
00002660  20 20 20 7c 5c 0a 20 20  20 20 20 20 20 20 20 20  |   |\.          |
00002670  20 2b 2d 2d 2d 2b 20 5c  20 20 20 20 20 41 78 65  | +---+ \     Axe|
00002680  73 3a 0a 20 20 20 20 20  20 20 20 20 20 20 7c 5c  |s:.           |\|
00002690  20 20 20 5c 20 5c 20 20  20 20 20 20 7a 0a 20 20  |   \ \      z.  |
000026a0  20 20 20 20 20 2b 2d 2d  2d 2b 20 5c 20 20 20 5c  |     +---+ \   \|
000026b0  20 2b 20 20 20 20 20 7c  0a 20 20 20 20 20 20 20  | +     |.       |
000026c0  7c 5c 20 20 20 5c 20 5c  20 20 20 5c 7c 20 20 20  ||\   \ \   \|   |
000026d0  20 20 7c 0a 20 20 20 2b  2d 2d 2d 2b 20 5c 20 20  |  |.   +---+ \  |
000026e0  20 5c 20 2b 2d 2d 2d 2b  20 20 20 20 20 2a 2d 2d  | \ +---+     *--|
000026f0  2d 2d 2d 79 0a 20 20 20  20 5c 20 20 20 5c 20 5c  |---y.    \   \ \|
00002700  20 20 20 5c 7c 20 20 20  20 20 20 20 20 20 20 5c  |   \|          \|
00002710  0a 20 20 20 20 20 4f 20  20 20 5c 20 2b 2d 2d 2d  |.     O   \ +---|
00002720  2b 20 20 20 20 20 20 20  20 20 20 20 5c 0a 20 20  |+           \.  |
00002730  20 20 20 20 5c 20 20 20  5c 7c 20 20 20 20 20 20  |    \   \|      |
00002740  20 20 20 20 20 20 20 20  20 20 78 0a 20 20 20 20  |          x.    |
00002750  20 20 20 2b 2d 2d 2d 2b  20 20 20 20 20 20 20 20  |   +---+        |
00002760  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002770  4f 20 69 73 20 74 68 65  20 70 6f 73 69 74 69 6f  |O is the positio|
00002780  6e 20 6f 66 20 74 68 65  20 6f 72 69 67 69 6e 0a  |n of the origin.|
00002790  0a 20 20 20 20 20 54 68  65 20 61 62 6f 76 65 20  |.     The above |
000027a0  64 69 61 67 72 61 6d 20  73 68 6f 77 73 20 74 68  |diagram shows th|
000027b0  65 20 6f 72 69 65 6e 74  61 74 69 6f 6e 20 61 6e  |e orientation an|
000027c0  64 20 69 6e 69 74 69 61  6c 20 70 6f 73 69 74 69  |d initial positi|
000027d0  6f 6e 20 6f 66 20 74 68  65 0a 73 74 61 69 72 73  |on of the.stairs|
000027e0  2e 20 20 59 6f 75 20 77  69 6c 6c 20 6e 6f 72 6d  |.  You will norm|
000027f0  61 6c 6c 79 20 77 61 6e  74 20 74 6f 20 74 72 61  |ally want to tra|
00002800  6e 73 6c 61 74 65 20 74  68 65 20 73 74 61 69 72  |nslate the stair|
00002810  73 20 69 6e 20 74 68 65  20 2d 79 2c 2d 7a 0a 64  |s in the -y,-z.d|
00002820  69 72 65 63 74 69 6f 6e  20 61 66 74 65 72 20 63  |irection after c|
00002830  72 65 61 74 69 6e 67 20  74 68 65 6d 2e 20 20 4e  |reating them.  N|
00002840  6f 74 65 20 74 68 61 74  20 64 75 65 20 74 6f 20  |ote that due to |
00002850  74 68 65 20 6f 72 69 65  6e 74 61 74 69 6f 6e 2c  |the orientation,|
00002860  20 74 68 65 20 66 69 72  73 74 0a 76 69 65 77 20  | the first.view |
00002870  70 61 72 61 6d 65 74 65  72 20 77 69 6c 6c 20 6e  |parameter will n|
00002880  65 65 64 20 74 6f 20 62  65 20 62 65 74 77 65 65  |eed to be betwee|
00002890  6e 20 39 30 20 61 6e 64  20 32 37 30 20 66 6f 72  |n 90 and 270 for|
000028a0  20 74 68 65 20 76 69 65  77 70 6f 69 6e 74 20 74  | the viewpoint t|
000028b0  6f 20 62 65 20 6f 6e 0a  74 68 65 20 72 69 67 68  |o be on.the righ|
000028c0  74 20 73 69 64 65 20 6f  66 20 74 68 65 20 73 74  |t side of the st|
000028d0  61 69 72 73 2e 0a 20 20  20 20 20 4c 69 6b 65 20  |airs..     Like |
000028e0  74 68 65 20 73 68 65 65  74 2c 20 74 68 65 20 65  |the sheet, the e|
000028f0  78 74 65 6e 74 20 6f 66  20 74 68 65 20 73 74 61  |xtent of the sta|
00002900  69 72 73 20 69 73 20 69  6e 20 66 61 63 74 20 69  |irs is in fact i|
00002910  6e 66 69 6e 69 74 65 3a  20 73 6f 6c 69 64 73 20  |nfinite: solids |
00002920  64 6f 0a 6e 6f 74 20 66  61 6c 6c 20 6f 66 66 20  |do.not fall off |
00002930  74 68 65 20 73 69 64 65  73 20 6f 66 20 74 68 65  |the sides of the|
00002940  20 73 74 61 69 72 73 2c  20 61 6e 64 20 74 68 65  | stairs, and the|
00002950  20 73 74 61 69 72 73 20  63 6f 6e 74 69 6e 75 65  | stairs continue|
00002960  20 61 62 6f 76 65 20 61  6e 64 0a 62 65 6c 6f 77  | above and.below|
00002970  20 74 68 6f 73 65 20 77  68 69 63 68 20 61 72 65  | those which are|
00002980  20 76 69 73 69 62 6c 65  2e 0a 0a 0a 20 20 20 20  | visible....    |
00002990  20 43 52 45 41 54 49 4e  47 20 4f 42 4a 45 43 54  | CREATING OBJECT|
000029a0  53 3a 20 53 4f 4c 49 44  20 4f 42 4a 45 43 54 53  |S: SOLID OBJECTS|
000029b0  0a 0a 20 20 20 20 20 20  20 20 20 20 73 6f 6c 69  |..          soli|
000029c0  64 20 7b 0a 20 20 20 20  20 20 20 20 20 20 20 63  |d {.           c|
000029d0  72 65 61 74 65 20 7b 0a  20 20 20 20 20 20 20 20  |reate {.        |
000029e0  20 20 20 20 74 79 70 65  20 3c 6f 62 6a 65 63 74  |    type <object|
000029f0  5f 74 79 70 65 3e 0a 20  20 20 20 20 20 20 20 20  |_type>.         |
00002a00  20 20 20 70 6f 69 6e 74  73 20 3c 70 6f 69 6e 74  |   points <point|
00002a10  73 5f 73 70 65 63 3e 0a  20 20 20 20 20 20 20 20  |s_spec>.        |
00002a20  20 20 20 20 73 69 7a 65  20 3c 73 69 7a 65 5f 73  |    size <size_s|
00002a30  70 65 63 3e 0a 20 20 20  20 20 20 20 20 20 20 20  |pec>.           |
00002a40  7d 0a 20 20 20 20 20 20  20 20 20 20 20 73 63 61  |}.           sca|
00002a50  6c 65 20 3c 78 73 3e 2c  3c 79 73 3e 2c 3c 7a 73  |le <xs>,<ys>,<zs|
00002a60  3e 0a 20 20 20 20 20 20  20 20 20 20 20 6e 65 61  |>.           nea|
00002a70  72 62 6f 6e 64 73 20 7b  0a 20 20 20 20 20 20 20  |rbonds {.       |
00002a80  20 20 20 20 20 73 70 72  69 6e 67 5f 63 6f 6e 73  |     spring_cons|
00002a90  74 20 3c 6c 61 6d 62 64  61 3e 0a 20 20 20 20 20  |t <lambda>.     |
00002aa0  20 20 20 20 20 20 20 72  61 6e 67 65 20 3c 72 61  |       range <ra|
00002ab0  6e 67 65 5f 76 61 6c 3e  0a 20 20 20 20 20 20 20  |nge_val>.       |
00002ac0  20 20 20 20 7d 0a 20 20  20 20 20 20 20 20 20 20  |    }.          |
00002ad0  20 64 61 6d 70 69 6e 67  20 3c 64 61 6d 70 5f 76  | damping <damp_v|
00002ae0  61 6c 3e 0a 20 20 20 20  20 20 20 20 20 20 20 3c  |al>.           <|
00002af0  6f 74 68 65 72 20 63 6f  6d 6d 61 6e 64 73 3e 0a  |other commands>.|
00002b00  20 20 20 20 20 20 20 20  20 20 7d 0a 20 20 20 20  |          }.    |
00002b10  20 54 68 65 20 62 6c 6f  63 6b 20 74 6f 20 63 72  | The block to cr|
00002b20  65 61 74 65 20 61 20 73  6f 6c 69 64 20 73 74 61  |eate a solid sta|
00002b30  72 74 73 20 77 69 74 68  20 61 20 22 63 72 65 61  |rts with a "crea|
00002b40  74 65 22 20 62 6c 6f 63  6b 2c 20 6c 69 6b 65 0a  |te" block, like.|
00002b50  62 61 63 6b 67 72 6f 75  6e 64 73 2e 20 20 54 68  |backgrounds.  Th|
00002b60  65 20 6f 6e 6c 79 20 64  69 66 66 65 72 65 6e 63  |e only differenc|
00002b70  65 20 68 65 72 65 20 69  73 20 74 68 65 20 63 68  |e here is the ch|
00002b80  6f 69 63 65 20 6f 66 20  6f 62 6a 65 63 74 73 20  |oice of objects |
00002b90  79 6f 75 20 63 61 6e 0a  63 72 65 61 74 65 3a 20  |you can.create: |
00002ba0  61 20 73 68 65 65 74 2c  20 61 20 63 75 62 6f 69  |a sheet, a cuboi|
00002bb0  64 2c 20 61 20 63 75 62  65 2c 20 61 20 74 75 62  |d, a cube, a tub|
00002bc0  65 20 6f 72 20 61 20 63  6f 6d 70 6f 75 6e 64 20  |e or a compound |
00002bd0  6f 62 6a 65 63 74 2e 20  20 54 68 65 73 65 20 77  |object.  These w|
00002be0  69 6c 6c 0a 62 65 20 64  65 73 63 72 69 62 65 64  |ill.be described|
00002bf0  20 69 6e 64 69 76 69 64  75 61 6c 6c 79 20 6c 61  | individually la|
00002c00  74 65 72 2e 0a 20 20 20  20 20 54 68 65 20 73 63  |ter..     The sc|
00002c10  61 6c 65 20 63 6f 6d 6d  61 6e 64 20 69 73 20 6f  |ale command is o|
00002c20  70 74 69 6f 6e 61 6c 3a  20 69 74 20 6c 65 74 73  |ptional: it lets|
00002c30  20 79 6f 75 20 73 63 61  6c 65 20 61 6e 20 6f 62  | you scale an ob|
00002c40  6a 65 63 74 20 69 6e 20  74 68 65 20 78 2c 20 79  |ject in the x, y|
00002c50  0a 61 6e 64 20 7a 20 64  69 72 65 63 74 69 6f 6e  |.and z direction|
00002c60  73 2e 20 20 54 68 69 73  20 63 6f 6d 6d 61 6e 64  |s.  This command|
00002c70  20 69 73 20 6d 61 69 6e  6c 79 20 70 72 65 73 65  | is mainly prese|
00002c80  6e 74 20 74 6f 20 61 6c  6c 6f 77 20 79 6f 75 20  |nt to allow you |
00002c90  74 6f 20 63 68 61 6e 67  65 20 74 68 65 0a 73 69  |to change the.si|
00002ca0  7a 65 20 6f 66 20 61 20  63 6f 6d 70 6f 75 6e 64  |ze of a compound|
00002cb0  20 6f 62 6a 65 63 74 2c  20 77 68 69 63 68 20 77  | object, which w|
00002cc0  6f 75 6c 64 20 6f 74 68  65 72 77 69 73 65 20 62  |ould otherwise b|
00002cd0  65 20 76 65 72 79 20 74  65 64 69 6f 75 73 2e 20  |e very tedious. |
00002ce0  20 49 20 77 6f 75 6c 64  0a 61 64 76 69 73 65 20  | I would.advise |
00002cf0  74 68 61 74 20 79 6f 75  20 6b 65 65 70 20 74 68  |that you keep th|
00002d00  65 20 78 2c 20 79 20 61  6e 64 20 7a 20 73 63 61  |e x, y and z sca|
00002d10  6c 69 6e 67 73 20 73 69  6d 69 6c 61 72 2c 20 61  |lings similar, a|
00002d20  73 20 6f 62 6a 65 63 74  73 20 77 68 69 63 68 20  |s objects which |
00002d30  68 61 76 65 0a 64 69 66  66 65 72 65 6e 74 20 70  |have.different p|
00002d40  6f 69 6e 74 20 73 70 61  63 69 6e 67 73 20 69 6e  |oint spacings in|
00002d50  20 64 69 66 66 65 72 65  6e 74 20 64 69 72 65 63  | different direc|
00002d60  74 69 6f 6e 73 20 74 65  6e 64 20 74 6f 20 62 65  |tions tend to be|
00002d70  20 75 6e 73 74 61 62 6c  65 2e 20 20 54 68 65 0a  | unstable.  The.|
00002d80  73 63 61 6c 65 20 63 6f  6d 6d 61 6e 64 20 67 6f  |scale command go|
00002d90  65 73 20 62 65 66 6f 72  65 20 6e 65 61 72 62 6f  |es before nearbo|
00002da0  6e 64 73 20 62 65 63 61  75 73 65 20 6f 74 68 65  |nds because othe|
00002db0  72 77 69 73 65 20 77 6f  75 6c 64 20 67 65 74 20  |rwise would get |
00002dc0  73 74 72 65 74 63 68 65  64 3a 0a 79 6f 75 20 6d  |stretched:.you m|
00002dd0  61 79 20 77 61 6e 74 20  74 6f 20 75 73 65 20 74  |ay want to use t|
00002de0  68 69 73 20 65 66 66 65  63 74 2c 20 62 75 74 20  |his effect, but |
00002df0  6b 65 65 70 20 74 68 65  20 73 63 61 6c 65 20 66  |keep the scale f|
00002e00  61 63 74 6f 72 73 20 63  6c 6f 73 65 20 74 6f 20  |actors close to |
00002e10  31 20 74 6f 0a 70 72 65  76 65 6e 74 20 65 78 70  |1 to.prevent exp|
00002e20  6c 6f 73 69 6f 6e 73 2e  0a 0a 20 20 20 20 20 54  |losions...     T|
00002e30  68 65 20 22 6e 65 61 72  62 6f 6e 64 73 22 20 62  |he "nearbonds" b|
00002e40  6c 6f 63 6b 20 69 73 20  77 68 61 74 20 6d 61 6b  |lock is what mak|
00002e50  65 73 20 74 68 65 20 73  6f 6c 69 64 20 61 20 73  |es the solid a s|
00002e60  6f 6c 69 64 2e 20 20 49  74 20 6e 65 65 64 73 20  |olid.  It needs |
00002e70  74 6f 20 62 65 0a 70 75  74 20 61 66 74 65 72 20  |to be.put after |
00002e80  74 68 65 20 22 63 72 65  61 74 65 22 20 62 6c 6f  |the "create" blo|
00002e90  63 6b 2c 20 62 65 63 61  75 73 65 20 69 74 20 63  |ck, because it c|
00002ea0  72 65 61 74 65 73 20 61  6c 6c 20 74 68 65 20 6c  |reates all the l|
00002eb0  69 74 74 6c 65 20 73 70  72 69 6e 67 73 0a 77 68  |ittle springs.wh|
00002ec0  69 63 68 20 68 6f 6c 64  20 74 68 65 20 70 6f 69  |ich hold the poi|
00002ed0  6e 74 73 20 69 6e 20 74  68 65 20 6f 62 6a 65 63  |nts in the objec|
00002ee0  74 20 74 6f 67 65 74 68  65 72 2e 20 20 49 74 20  |t together.  It |
00002ef0  69 73 20 63 61 6c 6c 65  64 20 22 6e 65 61 72 62  |is called "nearb|
00002f00  6f 6e 64 73 22 0a 62 65  63 61 75 73 65 20 69 74  |onds".because it|
00002f10  20 6f 6e 6c 79 20 62 6f  6e 64 73 20 74 6f 67 65  | only bonds toge|
00002f20  74 68 65 72 20 70 6f 69  6e 74 73 20 77 68 69 63  |ther points whic|
00002f30  68 20 61 72 65 20 66 61  69 72 6c 79 20 63 6c 6f  |h are fairly clo|
00002f40  73 65 2e 20 20 54 68 65  20 6e 75 6d 62 65 72 0a  |se.  The number.|
00002f50  61 66 74 65 72 20 22 73  70 72 69 6e 67 5f 63 6f  |after "spring_co|
00002f60  6e 73 74 22 20 73 65 74  73 20 74 68 65 20 73 74  |nst" sets the st|
00002f70  69 66 66 6e 65 73 73 20  6f 66 20 74 68 65 20 73  |iffness of the s|
00002f80  70 72 69 6e 67 73 2c 20  61 6e 64 20 22 72 61 6e  |prings, and "ran|
00002f90  67 65 22 20 73 65 74 73  20 68 6f 77 0a 6e 65 61  |ge" sets how.nea|
00002fa0  72 20 74 77 6f 20 70 6f  69 6e 74 73 20 68 61 76  |r two points hav|
00002fb0  65 20 74 6f 20 62 65 20  66 6f 72 20 61 20 73 70  |e to be for a sp|
00002fc0  72 69 6e 67 20 74 6f 20  63 6f 6e 6e 65 63 74 20  |ring to connect |
00002fd0  74 68 65 6d 2e 20 20 46  6f 72 20 65 61 63 68 20  |them.  For each |
00002fe0  6f 62 6a 65 63 74 2c 0a  74 68 65 20 70 72 6f 67  |object,.the prog|
00002ff0  72 61 6d 20 77 6f 72 6b  73 20 6f 75 74 20 61 6e  |ram works out an|
00003000  20 61 76 65 72 61 67 65  20 22 6e 65 61 72 65 73  | average "neares|
00003010  74 2d 6e 65 69 67 68 62  6f 75 72 22 20 64 69 73  |t-neighbour" dis|
00003020  74 61 6e 63 65 20 28 63  61 6c 6c 20 74 68 69 73  |tance (call this|
00003030  20 44 29 2c 0a 61 6e 64  20 74 68 65 20 22 72 61  | D),.and the "ra|
00003040  6e 67 65 22 20 76 61 6c  75 65 20 69 73 20 69 6e  |nge" value is in|
00003050  20 74 65 72 6d 73 20 6f  66 20 44 2e 20 20 50 6f  | terms of D.  Po|
00003060  69 6e 74 73 20 77 69 74  68 20 61 20 73 65 70 61  |ints with a sepa|
00003070  72 61 74 69 6f 6e 20 6f  66 20 62 65 74 77 65 65  |ration of betwee|
00003080  6e 0a 44 2f 32 20 61 6e  64 20 44 20 61 72 65 20  |n.D/2 and D are |
00003090  6c 69 6e 6b 65 64 20 77  69 74 68 20 61 20 73 70  |linked with a sp|
000030a0  72 69 6e 67 20 6f 66 20  73 74 72 65 6e 67 74 68  |ring of strength|
000030b0  20 3c 6c 61 6d 62 64 61  3e 2c 20 61 6e 64 20 70  | <lambda>, and p|
000030c0  6f 69 6e 74 73 20 77 69  74 68 20 61 0a 73 65 70  |oints with a.sep|
000030d0  61 72 61 74 69 6f 6e 20  62 65 74 77 65 65 6e 20  |aration between |
000030e0  44 20 61 6e 64 20 44 2a  3c 72 61 6e 67 65 5f 76  |D and D*<range_v|
000030f0  61 6c 3e 20 61 72 65 20  6c 69 6e 6b 65 64 20 77  |al> are linked w|
00003100  69 74 68 20 61 20 73 70  72 69 6e 67 20 6f 66 20  |ith a spring of |
00003110  73 74 72 65 6e 67 74 68  0a 77 68 69 63 68 20 64  |strength.which d|
00003120  65 63 72 65 61 73 65 73  20 73 6d 6f 6f 74 68 6c  |ecreases smoothl|
00003130  79 20 64 6f 77 6e 20 74  6f 20 30 20 66 6f 72 20  |y down to 0 for |
00003140  44 2a 3c 72 61 6e 67 65  5f 76 61 6c 3e 2e 20 20  |D*<range_val>.  |
00003150  20 50 6f 69 6e 74 73 20  77 69 74 68 20 61 0a 73  | Points with a.s|
00003160  65 70 61 72 61 74 69 6f  6e 20 6f 66 20 6c 65 73  |eparation of les|
00003170  73 20 74 68 61 6e 20 44  2f 32 20 61 72 65 20 6e  |s than D/2 are n|
00003180  6f 74 20 63 6f 6e 6e 65  63 74 65 64 2e 0a 20 20  |ot connected..  |
00003190  20 20 20 54 68 65 20 22  64 61 6d 70 69 6e 67 22  |   The "damping"|
000031a0  20 63 6f 6d 6d 61 6e 64  20 73 68 6f 75 6c 64 20  | command should |
000031b0  62 65 20 66 6f 6c 6c 6f  77 65 64 20 62 79 20 61  |be followed by a|
000031c0  20 73 69 6e 67 6c 65 20  69 6e 74 65 67 65 72 3a  | single integer:|
000031d0  20 33 20 6f 72 20 34 0a  61 72 65 20 74 79 70 69  | 3 or 4.are typi|
000031e0  63 61 6c 20 76 61 6c 75  65 73 2e 20 20 53 6f 6c  |cal values.  Sol|
000031f0  69 64 20 6f 62 6a 65 63  74 73 20 6e 65 65 64 20  |id objects need |
00003200  68 61 76 65 20 74 68 65  20 6d 6f 74 69 6f 6e 20  |have the motion |
00003210  6f 66 20 74 68 65 69 72  20 70 6f 69 6e 74 73 0a  |of their points.|
00003220  22 64 61 6d 70 65 64 22  2c 20 6f 74 68 65 72 77  |"damped", otherw|
00003230  69 73 65 20 74 68 65 20  73 70 72 69 6e 67 73 20  |ise the springs |
00003240  77 6f 75 6c 64 20 6d 61  6b 65 20 74 68 65 6d 20  |would make them |
00003250  76 69 62 72 61 74 65 20  6f 75 74 20 6f 66 20 63  |vibrate out of c|
00003260  6f 6e 74 72 6f 6c 2e 20  0a 55 6e 66 6f 72 74 75  |ontrol. .Unfortu|
00003270  6e 61 74 65 6c 79 2c 20  74 68 65 20 64 61 6d 70  |nately, the damp|
00003280  69 6e 67 20 61 6c 73 6f  20 68 61 73 20 74 68 65  |ing also has the|
00003290  20 65 66 66 65 63 74 20  6f 66 20 73 74 6f 70 70  | effect of stopp|
000032a0  69 6e 67 20 74 68 65 20  77 68 6f 6c 65 20 6f 62  |ing the whole ob|
000032b0  6a 65 63 74 0a 6d 6f 76  69 6e 67 20 6f 72 20 72  |ject.moving or r|
000032c0  6f 74 61 74 69 6e 67 20  76 65 72 79 20 71 75 69  |otating very qui|
000032d0  63 6b 6c 79 2c 20 73 6f  20 74 68 69 6e 67 73 20  |ckly, so things |
000032e0  73 6f 6d 65 74 69 6d 65  73 20 6c 6f 6f 6b 20 61  |sometimes look a|
000032f0  73 20 69 66 20 74 68 65  79 20 61 72 65 0a 75 6e  |s if they are.un|
00003300  64 65 72 77 61 74 65 72  2e 20 20 47 65 6e 65 72  |derwater.  Gener|
00003310  61 6c 6c 79 2c 20 79 6f  75 20 77 69 6c 6c 20 77  |ally, you will w|
00003320  61 6e 74 20 74 68 65 20  73 6d 61 6c 6c 65 73 74  |ant the smallest|
00003330  20 76 61 6c 75 65 20 6f  66 20 64 61 6d 70 69 6e  | value of dampin|
00003340  67 20 77 68 69 63 68 20  69 73 0a 73 75 66 66 69  |g which is.suffi|
00003350  63 69 65 6e 74 20 74 6f  20 73 74 6f 70 20 74 68  |cient to stop th|
00003360  65 20 74 68 69 6e 67 20  65 78 70 6c 6f 64 69 6e  |e thing explodin|
00003370  67 2e 0a 0a 20 20 20 20  20 4f 54 48 45 52 20 43  |g...     OTHER C|
00003380  4f 4d 4d 41 4e 44 53 0a  20 20 20 20 20 54 68 65  |OMMANDS.     The|
00003390  72 65 20 61 72 65 20 74  77 6f 20 63 6f 6d 6d 61  |re are two comma|
000033a0  6e 64 73 20 79 6f 75 20  63 61 6e 20 75 73 65 20  |nds you can use |
000033b0  74 6f 20 70 6c 61 63 65  20 74 68 65 20 6f 62 6a  |to place the obj|
000033c0  65 63 74 20 77 68 65 72  65 20 79 6f 75 20 77 61  |ect where you wa|
000033d0  6e 74 0a 69 74 3a 0a 20  20 20 20 20 20 20 20 20  |nt.it:.         |
000033e0  20 74 72 61 6e 73 6c 61  74 65 20 3c 78 3e 2c 3c  | translate <x>,<|
000033f0  79 3e 2c 3c 7a 3e 0a 20  20 20 20 20 20 20 20 20  |y>,<z>.         |
00003400  20 72 6f 74 61 74 65 20  3c 78 72 3e 2c 3c 79 72  | rotate <xr>,<yr|
00003410  3e 2c 3c 7a 72 3e 0a 20  20 20 20 20 54 68 65 20  |>,<zr>.     The |
00003420  74 72 61 6e 73 6c 61 74  65 20 63 6f 6d 6d 61 6e  |translate comman|
00003430  64 20 68 61 73 20 62 65  65 6e 20 64 65 73 63 72  |d has been descr|
00003440  69 62 65 64 20 61 62 6f  76 65 2e 20 20 54 68 65  |ibed above.  The|
00003450  20 72 6f 74 61 74 65 20  63 6f 6d 6d 61 6e 64 0a  | rotate command.|
00003460  72 6f 74 61 74 65 73 20  74 68 65 20 6f 62 6a 65  |rotates the obje|
00003470  63 74 20 41 42 4f 55 54  20 54 48 45 20 4f 52 49  |ct ABOUT THE ORI|
00003480  47 49 4e 2e 20 20 49 74  20 72 6f 74 61 74 65 73  |GIN.  It rotates|
00003490  20 62 79 20 3c 78 72 3e  2c 20 3c 79 72 3e 20 61  | by <xr>, <yr> a|
000034a0  6e 64 20 3c 7a 72 3e 0a  64 65 67 72 65 65 73 20  |nd <zr>.degrees |
000034b0  61 62 6f 75 74 20 74 68  65 20 78 2c 20 79 2c 20  |about the x, y, |
000034c0  61 6e 64 20 7a 20 61 78  65 73 20 72 65 73 70 65  |and z axes respe|
000034d0  63 74 69 76 65 6c 79 2e  20 20 59 6f 75 20 63 61  |ctively.  You ca|
000034e0  6e 20 68 61 76 65 20 61  6e 79 20 6e 75 6d 62 65  |n have any numbe|
000034f0  72 20 6f 66 0a 74 72 61  6e 73 6c 61 74 65 20 61  |r of.translate a|
00003500  6e 64 20 72 6f 74 61 74  65 20 63 6f 6d 6d 61 6e  |nd rotate comman|
00003510  64 73 20 77 69 74 68 6f  75 74 20 66 65 61 72 20  |ds without fear |
00003520  6f 66 20 73 6c 6f 77 69  6e 67 20 64 6f 77 6e 20  |of slowing down |
00003530  74 68 65 20 70 72 6f 67  72 61 6d 2c 0a 62 65 63  |the program,.bec|
00003540  61 75 73 65 20 74 68 65  20 63 6f 6d 6d 61 6e 64  |ause the command|
00003550  73 20 6f 6e 6c 79 20 61  66 66 65 63 74 20 74 68  |s only affect th|
00003560  65 20 69 6e 69 74 69 61  6c 20 73 65 74 74 69 6e  |e initial settin|
00003570  67 20 75 70 2e 20 20 46  6f 72 20 65 78 61 6d 70  |g up.  For examp|
00003580  6c 65 2c 20 69 66 0a 79  6f 75 20 77 61 6e 74 20  |le, if.you want |
00003590  74 6f 20 72 6f 74 61 74  65 20 62 79 20 31 35 20  |to rotate by 15 |
000035a0  64 65 67 72 65 65 73 20  61 62 6f 75 74 20 74 68  |degrees about th|
000035b0  65 20 70 6f 69 6e 74 20  28 31 69 6e 2c 31 69 6e  |e point (1in,1in|
000035c0  2c 32 69 6e 29 2c 20 61  72 6f 75 6e 64 20 74 68  |,2in), around th|
000035d0  65 20 78 0a 61 78 69 73  2c 20 79 6f 75 20 63 6f  |e x.axis, you co|
000035e0  75 6c 64 20 75 73 65 3a  0a 20 20 20 20 20 20 20  |uld use:.       |
000035f0  20 20 20 74 72 61 6e 73  6c 61 74 65 20 2d 31 69  |   translate -1i|
00003600  6e 2c 2d 31 69 6e 2c 2d  32 69 6e 0a 20 20 20 20  |n,-1in,-2in.    |
00003610  20 20 20 20 20 20 72 6f  74 61 74 65 20 31 35 2c  |      rotate 15,|
00003620  30 2c 30 20 20 20 20 20  20 20 0a 20 20 20 20 20  |0,0       .     |
00003630  20 20 20 20 20 74 72 61  6e 73 6c 61 74 65 20 31  |     translate 1|
00003640  69 6e 2c 31 69 6e 2c 32  69 6e 0a 20 20 20 20 20  |in,1in,2in.     |
00003650  61 6e 64 20 74 68 65 6e  20 74 72 61 6e 73 6c 61  |and then transla|
00003660  74 65 20 74 68 65 20 73  6f 6c 69 64 20 74 6f 20  |te the solid to |
00003670  77 68 65 72 65 20 79 6f  75 20 77 61 6e 74 20 69  |where you want i|
00003680  74 2e 0a 20 20 20 20 20  54 68 65 72 65 20 61 72  |t..     There ar|
00003690  65 20 61 6e 6f 74 68 65  72 20 74 77 6f 20 63 6f  |e another two co|
000036a0  6d 6d 61 6e 64 73 20 77  68 69 63 68 20 63 61 6e  |mmands which can|
000036b0  20 67 6f 20 69 6e 20 61  20 73 6f 6c 69 64 20 62  | go in a solid b|
000036c0  6c 6f 63 6b 2c 20 62 75  74 20 74 68 65 73 65 0a  |lock, but these.|
000036d0  73 68 6f 75 6c 64 20 6f  6e 6c 79 20 62 65 20 67  |should only be g|
000036e0  69 76 65 6e 20 6f 6e 63  65 20 69 6e 20 65 61 63  |iven once in eac|
000036f0  68 20 73 6f 6c 69 64 2e  20 20 54 68 65 79 20 61  |h solid.  They a|
00003700  72 65 3a 0a 20 20 20 20  20 20 20 20 20 20 76 65  |re:.          ve|
00003710  6c 6f 63 69 74 79 20 3c  78 76 3e 2c 3c 79 76 3e  |locity <xv>,<yv>|
00003720  2c 3c 7a 76 3e 0a 20 20  20 20 20 20 20 20 20 20  |,<zv>.          |
00003730  70 75 6c 6c 20 3c 66 69  72 73 74 3e 2c 3c 6c 61  |pull <first>,<la|
00003740  73 74 3e 2c 3c 73 74 65  70 3e 2c 3c 78 76 3e 2c  |st>,<step>,<xv>,|
00003750  3c 79 76 3e 2c 3c 7a 76  3e 0a 20 20 20 20 20 54  |<yv>,<zv>.     T|
00003760  68 65 20 22 76 65 6c 6f  63 69 74 79 22 20 63 6f  |he "velocity" co|
00003770  6d 6d 61 6e 64 20 6a 75  73 74 20 67 69 76 65 73  |mmand just gives|
00003780  20 74 68 65 20 6f 62 6a  65 63 74 20 61 6e 20 69  | the object an i|
00003790  6e 69 74 69 61 6c 20 76  65 6c 6f 63 69 74 79 2e  |nitial velocity.|
000037a0  20 20 55 73 65 0a 74 72  69 61 6c 20 61 6e 64 20  |  Use.trial and |
000037b0  65 72 72 6f 72 20 74 6f  20 66 69 6e 64 20 74 68  |error to find th|
000037c0  65 20 62 65 73 74 20 76  61 6c 75 65 2c 20 62 75  |e best value, bu|
000037d0  74 20 74 68 65 20 73 69  7a 65 20 6f 66 20 6e 75  |t the size of nu|
000037e0  6d 62 65 72 73 20 77 69  6c 6c 20 6e 65 65 64 20  |mbers will need |
000037f0  74 6f 0a 62 65 20 61 72  6f 75 6e 64 20 61 20 66  |to.be around a f|
00003800  65 77 20 74 68 6f 75 73  61 6e 64 73 20 28 61 20  |ew thousands (a |
00003810  73 65 74 74 69 6e 67 20  6f 66 20 31 38 34 33 20  |setting of 1843 |
00003820  69 73 20 31 20 69 6e 63  68 20 70 65 72 20 73 65  |is 1 inch per se|
00003830  63 6f 6e 64 29 2e 20 20  4e 6f 74 65 0a 74 68 61  |cond).  Note.tha|
00003840  74 20 68 69 67 68 20 76  65 6c 6f 63 69 74 69 65  |t high velocitie|
00003850  73 20 77 69 6c 6c 20 71  75 69 63 6b 6c 79 20 62  |s will quickly b|
00003860  65 20 64 61 6d 70 65 64  20 64 6f 77 6e 2e 0a 20  |e damped down.. |
00003870  20 20 20 20 54 68 65 20  22 70 75 6c 6c 22 20 63  |    The "pull" c|
00003880  6f 6d 6d 61 6e 64 20 69  73 20 72 61 74 68 65 72  |ommand is rather|
00003890  20 6c 6f 77 2d 6c 65 76  65 6c 3a 20 69 74 20 6e  | low-level: it n|
000038a0  65 65 64 73 20 74 6f 20  72 65 66 65 72 20 74 6f  |eeds to refer to|
000038b0  20 74 68 65 0a 6e 75 6d  62 65 72 69 6e 67 20 6f  | the.numbering o|
000038c0  66 20 74 68 65 20 70 6f  69 6e 74 73 20 69 6e 20  |f the points in |
000038d0  61 6e 20 6f 62 6a 65 63  74 2e 20 20 54 68 65 20  |an object.  The |
000038e0  66 69 72 73 74 20 74 68  72 65 65 20 70 61 72 61  |first three para|
000038f0  6d 65 74 65 72 73 20 61  72 65 20 6c 69 6b 65 20  |meters are like |
00003900  61 0a 46 4f 52 2d 4e 45  58 54 20 6c 6f 6f 70 20  |a.FOR-NEXT loop |
00003910  77 68 69 63 68 20 64 65  66 69 6e 65 73 20 61 20  |which defines a |
00003920  73 65 74 20 6f 66 20 70  6f 69 6e 74 73 2c 20 61  |set of points, a|
00003930  6e 64 20 74 68 65 73 65  20 70 6f 69 6e 74 73 20  |nd these points |
00003940  61 72 65 20 67 69 76 65  6e 20 61 0a 66 69 78 65  |are given a.fixe|
00003950  64 20 76 65 6c 6f 63 69  74 79 20 67 69 76 65 6e  |d velocity given|
00003960  20 62 79 20 74 68 65 20  6c 61 73 74 20 74 68 72  | by the last thr|
00003970  65 65 20 70 61 72 61 6d  65 74 65 72 73 2e 20 20  |ee parameters.  |
00003980  4c 6f 6f 6b 20 61 74 20  74 68 65 20 73 69 6d 75  |Look at the simu|
00003990  6c 61 74 69 6f 6e 0a 73  63 72 69 70 74 20 22 43  |lation.script "C|
000039a0  6c 6f 74 68 50 75 6c 6c  22 20 66 6f 72 20 61 6e  |lothPull" for an|
000039b0  20 65 78 61 6d 70 6c 65  20 6f 66 20 74 68 65 20  | example of the |
000039c0  75 73 65 20 6f 66 20 74  68 69 73 20 63 6f 6d 6d  |use of this comm|
000039d0  61 6e 64 2e 0a 0a 54 48  45 20 43 55 42 4f 49 44  |and...THE CUBOID|
000039e0  20 4f 42 4a 45 43 54 0a  20 20 20 20 20 54 6f 20  | OBJECT.     To |
000039f0  63 72 65 61 74 65 20 61  20 63 75 62 6f 69 64 2c  |create a cuboid,|
00003a00  20 75 73 65 20 74 68 65  20 66 6f 6c 6c 6f 77 69  | use the followi|
00003a10  6e 67 20 70 61 72 61 6d  65 74 65 72 73 20 69 6e  |ng parameters in|
00003a20  20 74 68 65 20 22 63 72  65 61 74 65 22 20 62 6c  | the "create" bl|
00003a30  6f 63 6b 3a 0a 20 20 20  20 20 20 20 20 20 20 74  |ock:.          t|
00003a40  79 70 65 20 63 75 62 6f  69 64 0a 20 20 20 20 20  |ype cuboid.     |
00003a50  20 20 20 20 20 73 69 7a  65 20 3c 78 5f 73 69 7a  |     size <x_siz|
00003a60  65 3e 2c 3c 79 5f 73 69  7a 65 3e 2c 3c 7a 5f 73  |e>,<y_size>,<z_s|
00003a70  69 7a 65 3e 0a 20 20 20  20 20 20 20 20 20 20 70  |ize>.          p|
00003a80  6f 69 6e 74 73 20 3c 78  5f 70 74 73 3e 2c 3c 79  |oints <x_pts>,<y|
00003a90  5f 70 74 73 3e 2c 3c 7a  5f 70 74 73 3e 0a 20 20  |_pts>,<z_pts>.  |
00003aa0  20 20 20 54 68 65 20 6d  65 61 6e 69 6e 67 20 6f  |   The meaning o|
00003ab0  66 20 74 68 65 20 70 61  72 61 6d 65 74 65 72 73  |f the parameters|
00003ac0  20 69 73 20 68 6f 70 65  66 75 6c 6c 79 20 6f 62  | is hopefully ob|
00003ad0  76 69 6f 75 73 2e 20 20  49 74 20 69 73 20 61 20  |vious.  It is a |
00003ae0  67 6f 6f 64 20 69 64 65  61 0a 74 6f 20 6b 65 65  |good idea.to kee|
00003af0  70 20 74 68 65 20 73 65  70 61 72 61 74 69 6f 6e  |p the separation|
00003b00  20 6f 66 20 74 68 65 20  70 6f 69 6e 74 73 20 74  | of the points t|
00003b10  68 65 20 73 61 6d 65 20  69 6e 20 61 6c 6c 20 74  |he same in all t|
00003b20  68 72 65 65 20 64 69 72  65 63 74 69 6f 6e 73 2c  |hree directions,|
00003b30  20 69 65 2e 0a 3c 73 69  7a 65 3e 2f 3c 70 74 73  | ie..<size>/<pts|
00003b40  3e 20 73 68 6f 75 6c 64  20 62 65 20 73 69 6d 69  |> should be simi|
00003b50  6c 61 72 20 66 6f 72 20  78 2c 20 79 20 61 6e 64  |lar for x, y and|
00003b60  20 7a 2e 0a 0a 54 48 45  20 43 55 42 45 20 4f 42  | z...THE CUBE OB|
00003b70  4a 45 43 54 0a 20 20 20  20 20 54 68 65 20 73 65  |JECT.     The se|
00003b80  74 75 70 20 66 6f 72 20  61 20 63 75 62 65 20 69  |tup for a cube i|
00003b90  73 3a 20 20 20 20 20 20  0a 20 20 20 20 20 20 20  |s:      .       |
00003ba0  20 20 20 74 79 70 65 20  63 75 62 65 0a 20 20 20  |   type cube.   |
00003bb0  20 20 20 20 20 20 20 73  69 7a 65 20 3c 73 69 7a  |       size <siz|
00003bc0  65 3e 0a 20 20 20 20 20  20 20 20 20 20 70 6f 69  |e>.          poi|
00003bd0  6e 74 73 20 3c 70 74 73  3e 0a 20 20 20 20 20 54  |nts <pts>.     T|
00003be0  68 69 73 20 69 73 20 62  61 73 69 63 61 6c 6c 79  |his is basically|
00003bf0  20 74 68 65 20 73 61 6d  65 20 61 73 20 61 20 63  | the same as a c|
00003c00  75 62 6f 69 64 2c 20 65  78 63 65 70 74 20 74 68  |uboid, except th|
00003c10  65 20 70 61 72 61 6d 65  74 65 72 73 20 66 6f 72  |e parameters for|
00003c20  20 74 68 65 0a 74 68 72  65 65 20 64 69 72 65 63  | the.three direc|
00003c30  74 69 6f 6e 73 20 61 72  65 20 61 6c 6c 20 73 65  |tions are all se|
00003c40  74 20 74 6f 20 62 65 20  65 71 75 61 6c 2e 0a 0a  |t to be equal...|
00003c50  54 48 45 20 54 55 42 45  20 4f 42 4a 45 43 54 20  |THE TUBE OBJECT |
00003c60  20 20 20 20 20 20 0a 20  20 20 20 20 20 20 20 20  |      .         |
00003c70  20 74 79 70 65 20 74 75  62 65 0a 20 20 20 20 20  | type tube.     |
00003c80  20 20 20 20 20 73 69 7a  65 20 3c 6c 65 6e 67 74  |     size <lengt|
00003c90  68 3e 2c 3c 72 61 64 69  75 73 3e 2c 3c 74 68 69  |h>,<radius>,<thi|
00003ca0  63 6b 6e 65 73 73 3e 0a  20 20 20 20 20 20 20 20  |ckness>.        |
00003cb0  20 20 70 6f 69 6e 74 73  20 3c 6c 65 6e 67 74 68  |  points <length|
00003cc0  5f 70 74 73 3e 2c 3c 63  69 72 63 5f 70 6f 69 6e  |_pts>,<circ_poin|
00003cd0  74 73 3e 2c 3c 74 68 69  63 6b 5f 70 6f 69 6e 74  |ts>,<thick_point|
00003ce0  73 3e 0a 20 20 20 20 20  54 68 65 20 3c 6c 65 6e  |s>.     The <len|
00003cf0  67 74 68 3e 20 70 61 72  61 6d 65 74 65 72 20 73  |gth> parameter s|
00003d00  65 74 73 20 74 68 65 20  6c 65 6e 67 74 68 20 6f  |ets the length o|
00003d10  66 20 74 68 65 20 74 75  62 65 2e 20 20 3c 52 61  |f the tube.  <Ra|
00003d20  64 69 75 73 3e 20 73 65  74 73 20 74 68 65 0a 64  |dius> sets the.d|
00003d30  69 73 74 61 6e 63 65 20  66 72 6f 6d 20 74 68 65  |istance from the|
00003d40  20 61 78 69 73 20 6f 66  20 74 68 65 20 74 75 62  | axis of the tub|
00003d50  65 20 74 6f 20 74 68 65  20 63 65 6e 74 72 65 20  |e to the centre |
00003d60  6f 66 20 69 74 73 20 77  61 6c 6c 73 2c 20 61 6e  |of its walls, an|
00003d70  64 0a 3c 74 68 69 63 6b  6e 65 73 73 3e 20 73 65  |d.<thickness> se|
00003d80  74 73 20 74 68 65 20 77  61 6c 6c 20 74 68 69 63  |ts the wall thic|
00003d90  6b 6e 65 73 73 2e 0a 20  20 20 20 20 54 68 65 20  |kness..     The |
00003da0  74 68 72 65 65 20 70 6f  69 6e 74 73 20 70 61 72  |three points par|
00003db0  61 6d 65 74 65 72 73 20  73 65 74 20 74 68 65 20  |ameters set the |
00003dc0  6e 75 6d 62 65 72 20 6f  66 20 70 6f 69 6e 74 73  |number of points|
00003dd0  20 61 6c 6f 6e 67 20 74  68 65 20 6c 65 6e 67 74  | along the lengt|
00003de0  68 2c 0a 61 72 6f 75 6e  64 20 74 68 65 20 63 69  |h,.around the ci|
00003df0  72 63 75 6d 66 65 72 65  6e 63 65 20 61 6e 64 20  |rcumference and |
00003e00  61 63 72 6f 73 73 20 74  68 65 20 77 61 6c 6c 20  |across the wall |
00003e10  72 65 73 70 65 63 74 69  76 65 6c 79 2e 0a 20 20  |respectively..  |
00003e20  20 20 20 41 73 20 49 20  6d 65 6e 74 69 6f 6e 65  |   As I mentione|
00003e30  64 20 65 61 72 6c 69 65  72 2c 20 69 74 20 69 73  |d earlier, it is|
00003e40  20 61 20 67 6f 6f 64 20  69 64 65 61 20 74 6f 20  | a good idea to |
00003e50  6b 65 65 70 20 74 68 65  0a 22 6e 65 61 72 65 73  |keep the."neares|
00003e60  74 2d 6e 65 69 67 68 62  6f 75 72 22 20 64 69 73  |t-neighbour" dis|
00003e70  74 61 6e 63 65 20 66 61  69 72 6c 79 20 63 6f 6e  |tance fairly con|
00003e80  73 74 61 6e 74 2c 20 73  6f 20 61 73 20 61 20 72  |stant, so as a r|
00003e90  6f 75 67 68 20 67 75 69  64 65 2c 20 74 72 79 20  |ough guide, try |
00003ea0  74 6f 0a 6b 65 65 70 3a  0a 20 20 20 20 20 20 20  |to.keep:.       |
00003eb0  20 20 20 3c 6c 65 6e 67  74 68 5f 70 74 73 3e 20  |   <length_pts> |
00003ec0  20 20 3c 63 69 72 63 5f  70 6f 69 6e 74 73 3e 20  |  <circ_points> |
00003ed0  20 20 3c 74 68 69 63 6b  5f 70 6f 69 6e 74 73 3e  |  <thick_points>|
00003ee0  0a 20 20 20 20 20 20 20  20 20 20 2d 2d 2d 2d 2d  |.          -----|
00003ef0  2d 2d 2d 2d 2d 2d 2d 20  3d 20 2d 2d 2d 2d 2d 2d  |------- = ------|
*
00003f10  2d 2d 2d 2d 2d 2d 2d 2d  0a 20 20 20 20 20 20 20  |--------.       |
00003f20  20 20 20 20 20 3c 6c 65  6e 67 74 68 3e 20 20 20  |     <length>   |
00003f30  20 20 32 2a 50 49 2a 3c  72 61 64 69 75 73 3e 20  |  2*PI*<radius> |
00003f40  20 20 20 3c 74 68 69 63  6b 6e 65 73 73 3e 0a 20  |   <thickness>. |
00003f50  20 20 20 20 61 6e 64 0a  20 20 20 20 20 20 20 20  |    and.        |
00003f60  20 20 3c 72 61 64 69 75  73 3e 20 3e 20 32 2a 3c  |  <radius> > 2*<|
00003f70  74 68 69 63 6b 6e 65 73  73 3e 0a 20 20 20 20 20  |thickness>.     |
00003f80  54 68 65 73 65 20 61 72  65 20 6f 6e 6c 79 20 61  |These are only a|
00003f90  70 70 72 6f 78 69 6d 61  74 65 20 72 75 6c 65 73  |pproximate rules|
00003fa0  2c 20 73 6f 20 66 65 65  6c 20 66 72 65 65 20 74  |, so feel free t|
00003fb0  6f 20 74 72 79 20 74 68  69 6e 67 73 20 6f 75 74  |o try things out|
00003fc0  20 61 6e 64 0a 73 65 65  20 77 68 61 74 20 68 61  | and.see what ha|
00003fd0  70 70 65 6e 73 2e 0a 0a  0a 43 4f 4d 50 4f 55 4e  |ppens....COMPOUN|
00003fe0  44 20 4f 42 4a 45 43 54  53 0a 20 20 20 20 20 43  |D OBJECTS.     C|
00003ff0  6f 6d 70 6f 75 6e 64 20  6f 62 6a 65 63 74 73 20  |ompound objects |
00004000  6c 65 74 20 79 6f 75 20  73 74 69 63 6b 20 74 6f  |let you stick to|
00004010  67 65 74 68 65 72 20 61  6e 79 20 6e 75 6d 62 65  |gether any numbe|
00004020  72 20 6f 66 20 6f 74 68  65 72 20 73 6f 6c 69 64  |r of other solid|
00004030  73 20 74 6f 0a 63 72 65  61 74 65 20 61 20 6d 6f  |s to.create a mo|
00004040  72 65 20 63 6f 6d 70 6c  65 78 20 6f 62 6a 65 63  |re complex objec|
00004050  74 2e 20 20 48 65 72 65  20 69 73 20 61 6e 20 65  |t.  Here is an e|
00004060  78 61 6d 70 6c 65 20 6f  66 20 68 6f 77 20 61 20  |xample of how a |
00004070  63 6f 6d 70 6f 75 6e 64  20 6f 62 6a 65 63 74 0a  |compound object.|
00004080  6d 69 67 68 74 20 6c 6f  6f 6b 3a 0a 20 20 20 20  |might look:.    |
00004090  20 20 20 20 20 20 63 72  65 61 74 65 20 7b 0a 20  |      create {. |
000040a0  20 20 20 20 20 20 20 20  20 20 74 79 70 65 20 63  |          type c|
000040b0  6f 6d 70 6f 75 6e 64 0a  20 20 20 20 20 20 20 20  |ompound.        |
000040c0  20 20 20 70 61 72 74 20  7b 0a 20 20 20 20 20 20  |   part {.      |
000040d0  20 20 20 20 20 20 74 79  70 65 20 63 75 62 6f 69  |      type cuboi|
000040e0  64 0a 20 20 20 20 20 20  20 20 20 20 20 20 70 6f  |d.            po|
000040f0  69 6e 74 73 20 37 2c 33  2c 33 0a 20 20 20 20 20  |ints 7,3,3.     |
00004100  20 20 20 20 20 20 20 73  69 7a 65 20 33 69 6e 2c  |       size 3in,|
00004110  31 69 6e 2c 31 69 6e 0a  20 20 20 20 20 20 20 20  |1in,1in.        |
00004120  20 20 20 20 6f 66 66 73  65 74 20 31 69 6e 2c 30  |    offset 1in,0|
00004130  2c 30 0a 20 20 20 20 20  20 20 20 20 20 20 7d 0a  |,0.           }.|
00004140  20 20 20 20 20 20 20 20  20 20 20 70 61 72 74 20  |           part |
00004150  7b 20 74 79 70 65 20 63  75 62 6f 69 64 3a 70 6f  |{ type cuboid:po|
00004160  69 6e 74 73 20 33 2c 33  2c 31 31 3a 73 69 7a 65  |ints 3,3,11:size|
00004170  20 31 69 6e 2c 31 69 6e  2c 35 69 6e 20 7d 0a 20  | 1in,1in,5in }. |
00004180  20 20 20 20 20 20 20 20  20 20 70 61 72 74 20 7b  |          part {|
00004190  20 74 79 70 65 20 63 75  62 6f 69 64 3a 70 6f 69  | type cuboid:poi|
000041a0  6e 74 73 20 33 2c 37 2c  33 3a 73 69 7a 65 20 31  |nts 3,7,3:size 1|
000041b0  69 6e 2c 33 69 6e 2c 31  69 6e 3a 6f 66 66 73 65  |in,3in,1in:offse|
000041c0  74 20 30 2c 31 69 6e 2c  30 20 7d 0a 20 20 20 20  |t 0,1in,0 }.    |
000041d0  20 20 20 20 20 20 7d 0a  20 20 20 20 20 54 68 65  |      }.     The|
000041e0  20 66 69 72 73 74 20 6c  69 6e 65 20 69 6e 20 74  | first line in t|
000041f0  68 65 20 22 63 72 65 61  74 65 22 20 62 6c 6f 63  |he "create" bloc|
00004200  6b 20 69 73 20 22 74 79  70 65 20 63 6f 6d 70 6f  |k is "type compo|
00004210  75 6e 64 22 2c 20 74 68  65 6e 20 74 68 65 72 65  |und", then there|
00004220  20 69 73 0a 61 20 6c 69  73 74 20 6f 66 20 22 70  | is.a list of "p|
00004230  61 72 74 22 20 62 6c 6f  63 6b 73 2e 20 20 45 61  |art" blocks.  Ea|
00004240  63 68 20 6f 66 20 74 68  65 73 65 20 69 73 20 6d  |ch of these is m|
00004250  75 63 68 20 6c 69 6b 65  20 61 20 22 63 72 65 61  |uch like a "crea|
00004260  74 65 22 20 62 6c 6f 63  6b 20 28 69 74 0a 68 61  |te" block (it.ha|
00004270  73 20 74 79 70 65 2c 20  73 69 7a 65 20 61 6e 64  |s type, size and|
00004280  20 70 6f 69 6e 74 73 20  63 6f 6d 6d 61 6e 64 73  | points commands|
00004290  29 2c 20 62 75 74 20 77  69 74 68 20 74 68 65 20  |), but with the |
000042a0  66 6f 6c 6c 6f 77 69 6e  67 20 64 69 66 66 65 72  |following differ|
000042b0  65 6e 63 65 73 3a 20 31  20 20 20 20 0a 59 6f 75  |ences: 1    .You|
000042c0  20 63 61 6e 20 61 64 64  20 61 6e 20 22 6f 66 66  | can add an "off|
000042d0  73 65 74 22 20 63 6f 6d  6d 61 6e 64 20 61 74 20  |set" command at |
000042e0  74 68 65 20 65 6e 64 20  32 20 20 20 20 20 59 6f  |the end 2     Yo|
000042f0  75 20 63 61 6e 6e 6f 74  20 68 61 76 65 20 61 20  |u cannot have a |
00004300  63 6f 6d 70 6f 75 6e 64  0a 74 79 70 65 20 6f 62  |compound.type ob|
00004310  6a 65 63 74 20 61 73 20  61 20 70 61 72 74 21 0a  |ject as a part!.|
00004320  20 20 20 20 20 54 68 65  20 22 6f 66 66 73 65 74  |     The "offset|
00004330  22 20 63 6f 6d 6d 61 6e  64 20 69 73 20 65 78 61  |" command is exa|
00004340  63 74 6c 79 20 65 71 75  69 76 61 6c 65 6e 74 20  |ctly equivalent |
00004350  74 6f 20 61 20 22 74 72  61 6e 73 6c 61 74 65 22  |to a "translate"|
00004360  20 63 6f 6d 6d 61 6e 64  2c 0a 62 75 74 20 6f 6e  | command,.but on|
00004370  6c 79 20 61 70 70 6c 69  65 73 20 74 6f 20 74 68  |ly applies to th|
00004380  65 20 70 61 72 74 69 63  75 6c 61 72 20 70 61 72  |e particular par|
00004390  74 20 77 68 6f 73 65 20  62 6c 6f 63 6b 20 69 74  |t whose block it|
000043a0  20 69 73 20 69 6e 2e 0a  20 20 20 20 20 49 6e 20  | is in..     In |
000043b0  74 68 65 20 65 78 61 6d  70 6c 65 20 61 62 6f 76  |the example abov|
000043c0  65 2c 20 74 68 65 20 66  69 72 73 74 20 22 70 61  |e, the first "pa|
000043d0  72 74 22 20 62 6c 6f 63  6b 20 69 73 20 77 72 69  |rt" block is wri|
000043e0  74 74 65 6e 20 6f 75 74  20 77 69 74 68 20 6f 6e  |tten out with on|
000043f0  65 0a 63 6f 6d 6d 61 6e  64 20 70 65 72 20 6c 69  |e.command per li|
00004400  6e 65 2c 20 62 75 74 20  74 68 65 20 72 65 73 74  |ne, but the rest|
00004410  20 61 72 65 20 63 6f 6e  74 72 61 63 74 65 64 20  | are contracted |
00004420  6f 6e 74 6f 20 6f 6e 65  20 6c 69 6e 65 20 65 61  |onto one line ea|
00004430  63 68 20 62 79 0a 72 65  70 6c 61 63 69 6e 67 20  |ch by.replacing |
00004440  6e 65 77 6c 69 6e 65 73  20 77 69 74 68 20 63 6f  |newlines with co|
00004450  6c 6f 6e 73 2e 20 20 52  65 6d 65 6d 62 65 72 20  |lons.  Remember |
00004460  74 68 61 74 20 74 68 65  20 63 75 72 6c 79 20 62  |that the curly b|
00004470  72 61 63 6b 65 74 73 20  6d 75 73 74 20 62 65 0a  |rackets must be.|
00004480  73 65 70 61 72 61 74 65  64 20 66 72 6f 6d 20 74  |separated from t|
00004490  68 65 20 63 6f 6d 6d 61  6e 64 73 2c 20 65 6c 73  |he commands, els|
000044a0  65 20 79 6f 75 20 77 69  6c 6c 20 67 65 74 20 61  |e you will get a|
000044b0  6e 20 65 72 72 6f 72 2e  20 20 54 68 65 72 65 20  |n error.  There |
000044c0  69 73 20 6e 6f 20 6c 69  6d 69 74 0a 6f 6e 20 74  |is no limit.on t|
000044d0  68 65 20 6e 75 6d 62 65  72 20 6f 66 20 70 61 72  |he number of par|
000044e0  74 73 20 61 20 63 6f 6d  70 6f 75 6e 64 20 6f 62  |ts a compound ob|
000044f0  6a 65 63 74 20 63 61 6e  20 68 61 76 65 2e 20 20  |ject can have.  |
00004500  43 6f 6d 70 6f 75 6e 64  20 73 6f 6c 69 64 73 20  |Compound solids |
00004510  77 6f 72 6b 20 62 79 0a  6c 65 74 74 69 6e 67 20  |work by.letting |
00004520  79 6f 75 20 63 72 65 61  74 65 20 73 65 76 65 72  |you create sever|
00004530  61 6c 20 6f 62 6a 65 63  74 73 20 62 65 66 6f 72  |al objects befor|
00004540  65 20 79 6f 75 20 75 73  65 20 74 68 65 20 22 6e  |e you use the "n|
00004550  65 61 72 62 6f 6e 64 73  22 20 63 6f 6d 6d 61 6e  |earbonds" comman|
00004560  64 2e 20 0a 57 68 65 6e  20 79 6f 75 20 64 6f 20  |d. .When you do |
00004570  75 73 65 20 74 68 69 73  20 63 6f 6d 6d 61 6e 64  |use this command|
00004580  2c 20 69 74 20 63 6f 6e  6e 65 63 74 73 20 74 68  |, it connects th|
00004590  65 20 70 61 72 74 73 20  74 6f 67 65 74 68 65 72  |e parts together|
000045a0  2e 20 20 54 68 69 73 20  6d 65 74 68 6f 64 0a 6d  |.  This method.m|
000045b0  65 61 6e 73 20 74 68 61  74 20 70 61 72 74 73 20  |eans that parts |
000045c0  77 69 6c 6c 20 6e 6f 74  20 67 65 74 20 63 6f 6e  |will not get con|
000045d0  6e 65 63 74 65 64 20 69  66 20 74 68 65 79 20 61  |nected if they a|
000045e0  72 65 20 73 65 70 61 72  61 74 65 64 20 62 79 20  |re separated by |
000045f0  6d 6f 72 65 20 74 68 61  6e 0a 74 68 65 20 72 61  |more than.the ra|
00004600  6e 67 65 20 6f 66 20 74  68 65 20 22 6e 65 61 72  |nge of the "near|
00004610  62 6f 6e 64 73 22 20 63  6f 6d 6d 61 6e 64 2e 20  |bonds" command. |
00004620  20 59 6f 75 20 73 68 6f  75 6c 64 20 61 6c 73 6f  | You should also|
00004630  20 6e 6f 74 20 6c 65 74  20 70 61 72 74 73 20 70  | not let parts p|
00004640  61 73 73 0a 74 68 72 6f  75 67 68 20 65 61 63 68  |ass.through each|
00004650  20 6f 74 68 65 72 2c 20  61 73 20 74 68 65 20 72  | other, as the r|
00004660  65 73 75 6c 74 69 6e 67  20 63 6f 6d 70 6f 75 6e  |esulting compoun|
00004670  64 20 6f 62 6a 65 63 74  20 69 73 20 75 6e 73 74  |d object is unst|
00004680  61 62 6c 65 2e 20 20 53  69 6e 63 65 20 74 68 65  |able.  Since the|
00004690  0a 6e 65 61 72 62 6f 6e  64 73 20 72 6f 75 74 69  |.nearbonds routi|
000046a0  6e 65 20 69 73 20 77 6f  72 6b 69 6e 67 20 6f 6e  |ne is working on|
000046b0  20 61 6c 6c 20 74 68 65  20 70 61 72 74 73 20 69  | all the parts i|
000046c0  6e 20 6f 6e 65 20 67 6f  2c 20 79 6f 75 20 73 68  |n one go, you sh|
000046d0  6f 75 6c 64 20 61 6c 73  6f 0a 6b 65 65 70 20 74  |ould also.keep t|
000046e0  68 65 20 6e 65 61 72 65  73 74 2d 6e 65 69 67 68  |he nearest-neigh|
000046f0  62 6f 75 72 20 64 69 73  74 61 6e 63 65 73 20 66  |bour distances f|
00004700  6f 72 20 61 6c 6c 20 74  68 65 20 70 61 72 74 73  |or all the parts|
00004710  20 73 69 6d 69 6c 61 72  2e 0a 0a 47 45 54 54 49  | similar...GETTI|
00004720  4e 47 20 53 43 52 45 45  4e 53 48 4f 54 53 0a 20  |NG SCREENSHOTS. |
00004730  20 20 20 20 54 68 65 72  65 20 69 73 20 6e 6f 20  |    There is no |
00004740  62 75 69 6c 74 2d 69 6e  20 66 61 63 69 6c 69 74  |built-in facilit|
00004750  79 20 66 6f 72 20 6f 62  74 61 69 6e 69 6e 67 20  |y for obtaining |
00004760  73 63 72 65 65 6e 73 68  6f 74 73 2c 20 62 75 74  |screenshots, but|
00004770  20 69 74 20 69 73 0a 73  69 6d 70 6c 65 20 74 6f  | it is.simple to|
00004780  20 64 6f 20 74 68 69 73  20 62 79 20 61 64 64 69  | do this by addi|
00004790  6e 67 20 61 20 6c 69 6e  65 20 74 6f 20 50 52 4f  |ng a line to PRO|
000047a0  43 66 72 61 6d 65 5f 61  63 74 69 6f 6e 73 20 69  |Cframe_actions i|
000047b0  6e 20 74 68 65 20 70 72  6f 67 72 61 6d 2e 20 0a  |n the program. .|
000047c0  54 68 69 73 20 70 72 6f  63 65 64 75 72 65 20 69  |This procedure i|
000047d0  73 20 63 61 6c 6c 65 64  20 61 66 74 65 72 20 65  |s called after e|
000047e0  61 63 68 20 66 72 61 6d  65 20 68 61 73 20 62 65  |ach frame has be|
000047f0  65 6e 20 64 72 61 77 6e  2c 20 77 69 74 68 20 74  |en drawn, with t|
00004800  68 65 20 66 72 61 6d 65  0a 6e 75 6d 62 65 72 20  |he frame.number |
00004810  70 61 73 73 65 64 20 69  6e 20 66 72 61 6d 65 25  |passed in frame%|
00004820  2e 20 20 54 6f 20 73 61  76 65 20 61 20 70 69 63  |.  To save a pic|
00004830  74 75 72 65 20 6f 66 20  66 72 61 6d 65 20 33 30  |ture of frame 30|
00004840  2c 20 61 64 64 20 61 20  6c 69 6e 65 20 61 74 20  |, add a line at |
00004850  74 68 65 0a 62 65 67 69  6e 6e 69 6e 67 20 6f 66  |the.beginning of|
00004860  20 50 52 4f 43 66 72 61  6d 65 5f 61 63 74 69 6f  | PROCframe_actio|
00004870  6e 73 20 77 68 69 63 68  20 73 61 79 73 3a 0a 20  |ns which says:. |
00004880  20 20 20 20 20 20 20 20  20 49 46 20 66 72 61 6d  |         IF fram|
00004890  65 25 3d 33 30 20 54 48  45 4e 20 2a 53 63 72 65  |e%=30 THEN *Scre|
000048a0  65 6e 53 61 76 65 20 46  45 4d 53 70 69 63 33 30  |enSave FEMSpic30|
000048b0  0a 20 20 20 20 20 59 6f  75 20 63 6f 75 6c 64 20  |.     You could |
000048c0  61 6c 73 6f 20 6d 61 6b  65 20 74 68 65 20 53 63  |also make the Sc|
000048d0  72 65 65 6e 53 61 76 65  20 63 6f 6e 64 69 74 69  |reenSave conditi|
000048e0  6f 6e 61 6c 20 6f 6e 20  74 68 65 20 41 6c 74 20  |onal on the Alt |
000048f0  6b 65 79 20 62 65 69 6e  67 0a 68 65 6c 64 20 64  |key being.held d|
00004900  6f 77 6e 2c 20 66 6f 72  20 65 78 61 6d 70 6c 65  |own, for example|
00004910  2e 0a 0a 46 41 43 45 54  20 4f 55 54 50 55 54 0a  |...FACET OUTPUT.|
00004920  20 20 20 20 20 49 20 68  61 76 65 20 69 6e 63 6c  |     I have incl|
00004930  75 64 65 64 20 69 6e 20  74 68 65 20 70 72 6f 67  |uded in the prog|
00004940  72 61 6d 20 61 20 66 61  63 69 6c 69 74 79 20 74  |ram a facility t|
00004950  6f 20 6f 75 74 70 75 74  20 74 68 65 20 63 6f 6f  |o output the coo|
00004960  72 64 69 6e 61 74 65 73  20 6f 66 0a 61 6c 6c 20  |rdinates of.all |
00004970  74 68 65 20 74 72 69 61  6e 67 75 6c 61 72 20 22  |the triangular "|
00004980  66 61 63 65 74 73 22 20  77 68 69 63 68 20 6d 61  |facets" which ma|
00004990  6b 65 20 75 70 20 74 68  65 20 73 75 72 66 61 63  |ke up the surfac|
000049a0  65 73 20 6f 66 20 74 68  65 20 6f 62 6a 65 63 74  |es of the object|
000049b0  73 2e 20 20 59 6f 75 0a  63 6f 75 6c 64 20 75 73  |s.  You.could us|
000049c0  65 20 74 68 69 73 20 64  61 74 61 20 74 6f 20 63  |e this data to c|
000049d0  72 65 61 74 65 20 61 6e  20 69 6e 70 75 74 20 66  |reate an input f|
000049e0  69 6c 65 20 66 6f 72 20  61 20 72 61 79 20 74 72  |ile for a ray tr|
000049f0  61 63 65 72 20 6f 72 20  6f 74 68 65 72 20 33 44  |acer or other 3D|
00004a00  0a 72 65 6e 64 65 72 69  6e 67 20 70 72 6f 67 72  |.rendering progr|
00004a10  61 6d 2e 20 20 41 73 20  66 6f 72 20 73 63 72 65  |am.  As for scre|
00004a20  65 6e 73 68 6f 74 73 2c  20 79 6f 75 20 6a 75 73  |enshots, you jus|
00004a30  74 20 61 64 64 20 61 20  6c 69 6e 65 20 74 6f 0a  |t add a line to.|
00004a40  50 52 4f 43 66 72 61 6d  65 5f 61 63 74 69 6f 6e  |PROCframe_action|
00004a50  73 20 6c 69 6b 65 3a 0a  20 20 20 20 20 20 20 20  |s like:.        |
00004a60  20 20 49 46 20 66 72 61  6d 65 25 3d 33 30 20 54  |  IF frame%=30 T|
00004a70  48 45 4e 20 50 52 4f 43  6f 75 74 70 75 74 5f 66  |HEN PROCoutput_f|
00004a80  61 63 65 74 73 28 22 24  2e 54 65 6d 70 2e 66 61  |acets("$.Temp.fa|
00004a90  63 65 74 73 33 30 22 29  0a 20 20 20 20 20 77 68  |cets30").     wh|
00004aa0  69 63 68 20 77 69 6c 6c  20 63 72 65 61 74 65 20  |ich will create |
00004ab0  61 20 64 61 74 61 20 66  69 6c 65 20 77 68 65 6e  |a data file when|
00004ac0  20 74 68 65 20 70 72 6f  67 72 61 6d 20 72 65 61  | the program rea|
00004ad0  63 68 65 73 20 74 68 65  20 33 30 74 68 20 66 72  |ches the 30th fr|
00004ae0  61 6d 65 2e 20 0a 54 68  65 20 64 61 74 61 20 66  |ame. .The data f|
00004af0  69 6c 65 20 63 6f 6e 73  69 73 74 73 20 6f 66 20  |ile consists of |
00004b00  61 20 6c 69 73 74 20 6f  66 20 6e 75 6d 62 65 72  |a list of number|
00004b10  73 20 77 68 69 63 68 20  63 61 6e 20 74 68 65 20  |s which can the |
00004b20  72 65 61 64 20 62 79 20  61 0a 20 20 20 20 20 20  |read by a.      |
00004b30  20 20 20 20 49 4e 50 55  54 23 63 68 61 6e 25 2c  |    INPUT#chan%,|
00004b40  41 25 0a 20 20 20 20 20  74 79 70 65 20 42 41 53  |A%.     type BAS|
00004b50  49 43 20 73 74 61 74 65  6d 65 6e 74 2e 20 20 59  |IC statement.  Y|
00004b60  6f 75 20 63 61 6e 20 72  65 61 64 20 74 68 65 20  |ou can read the |
00004b70  66 69 6c 65 20 77 69 74  68 20 61 20 70 72 6f 67  |file with a prog|
00004b80  72 61 6d 20 77 68 69 63  68 20 6c 6f 6f 6b 73 0a  |ram which looks.|
00004b90  73 6f 6d 65 74 68 69 6e  67 20 6c 69 6b 65 20 74  |something like t|
00004ba0  68 69 73 3a 0a 0a 20 20  20 20 20 20 20 20 20 20  |his:..          |
00004bb0  52 45 50 45 41 54 0a 20  20 20 20 20 20 20 20 20  |REPEAT.         |
00004bc0  20 20 49 4e 50 55 54 23  63 68 61 6e 25 2c 41 25  |  INPUT#chan%,A%|
00004bd0  0a 20 20 20 20 20 20 20  20 20 20 20 49 46 20 41  |.           IF A|
00004be0  25 3c 3e 31 20 54 48 45  4e 20 45 52 52 4f 52 20  |%<>1 THEN ERROR |
00004bf0  31 2c 22 42 61 64 20 66  69 6c 65 22 0a 20 20 20  |1,"Bad file".   |
00004c00  20 20 20 20 20 20 20 20  49 4e 50 55 54 23 63 68  |        INPUT#ch|
00004c10  61 6e 25 2c 4e 25 0a 20  20 20 20 20 20 20 20 20  |an%,N%.         |
00004c20  20 20 46 4f 52 20 69 25  3d 31 20 54 4f 20 4e 25  |  FOR i%=1 TO N%|
00004c30  0a 20 20 20 20 20 20 20  20 20 20 20 20 49 4e 50  |.            INP|
00004c40  55 54 23 63 68 61 6e 25  2c 58 31 25 2c 59 31 25  |UT#chan%,X1%,Y1%|
00004c50  2c 5a 31 25 0a 20 20 20  20 20 20 20 20 20 20 20  |,Z1%.           |
00004c60  20 49 4e 50 55 54 23 63  68 61 6e 25 2c 58 32 25  | INPUT#chan%,X2%|
00004c70  2c 59 32 25 2c 5a 32 25  0a 20 20 20 20 20 20 20  |,Y2%,Z2%.       |
00004c80  20 20 20 20 20 49 4e 50  55 54 23 63 68 61 6e 25  |     INPUT#chan%|
00004c90  2c 58 33 25 2c 59 33 25  2c 5a 33 25 0a 20 20 20  |,X3%,Y3%,Z3%.   |
00004ca0  20 20 20 20 20 20 20 20  20 52 45 4d 20 64 6f 20  |         REM do |
00004cb0  73 6f 6d 65 74 68 69 6e  67 20 77 69 74 68 20 74  |something with t|
00004cc0  68 65 20 64 61 74 61 20  68 65 72 65 0a 20 20 20  |he data here.   |
00004cd0  20 20 20 20 20 20 20 20  4e 45 58 54 0a 20 20 20  |        NEXT.   |
00004ce0  20 20 20 20 20 20 20 55  4e 54 49 4c 20 45 4f 46  |       UNTIL EOF|
00004cf0  23 63 68 61 6e 25 0a 0a  20 20 20 20 20 54 68 65  |#chan%..     The|
00004d00  20 63 6f 6f 72 64 69 6e  61 74 65 73 20 6f 66 20  | coordinates of |
00004d10  74 68 65 20 74 68 72 65  65 20 63 6f 72 6e 65 72  |the three corner|
00004d20  73 20 6f 66 20 65 61 63  68 20 66 61 63 65 74 20  |s of each facet |
00004d30  61 72 65 20 67 69 76 65  6e 20 69 6e 20 75 6e 69  |are given in uni|
00004d40  74 73 0a 6f 66 20 31 2f  36 34 30 74 68 20 6f 66  |ts.of 1/640th of|
00004d50  20 61 20 70 6f 69 6e 74  2c 20 77 68 69 63 68 20  | a point, which |
00004d60  69 73 20 31 2f 26 42 34  30 30 20 6f 66 20 61 6e  |is 1/&B400 of an|
00004d70  20 69 6e 63 68 2e 0a 0a  20 20 20 20 20 48 61 76  | inch...     Hav|
00004d80  65 20 66 75 6e 21                                 |e fun!|
00004d86