home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / r / rtag20.zip / RTAG.DOC < prev    next >
Text File  |  1993-03-04  |  86KB  |  1,807 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                                       R T A G
  11.  
  12.  
  13.  
  14.                           Ray Tracing Animation Generator
  15.  
  16.                                A "shareware" program
  17.  
  18.  
  19.  
  20.  
  21.                                 Phillip H. Sherrod
  22.  
  23.                Member, Association of Shareware Professionals (ASP)
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.               RTAG  is  a program to facilitate the generation of ray
  31.               traced animations.  RTAG is not a ray tracing  program;
  32.               rather,  it  enables  you  to  generate the appropriate
  33.               position of objects to produce an animation  using  the
  34.               ray tracing  program  of  your choice.  RTAG compiles a
  35.               programming language designed for animation generation.
  36.               This  programming  language  contains  full  arithmetic
  37.               expressions,  conditional  control, looping, I/O, and a
  38.               rich set of library  functions  including  spline  path
  39.               generation.   The output of RTAG is a set of files that
  40.               can be used to  drive  ray  tracing  programs  such  as
  41.               POV-Ray,  or other ray tracers, to produce an image for
  42.               each frame.
  43.  
  44.                RTAG -- Ray Tracing Animation Generator      Page 1
  45.  
  46.  
  47.  
  48.  
  49.          INTRODUCTION TO ANIMATION GENERATION
  50.  
  51.          An  animation  is  composed  of  a sequence of individual images,
  52.          called "frames," which are displayed rapidly to give the illusion
  53.          of motion.  Anyone who sets out to create an animation must  deal
  54.          with  two  design  issues:  (1) the generation of the basic scene
  55.          (objects, colors, lights, etc.), and (2) the changing position of
  56.          the objects between frames.  RTAG deals with the second of  these
  57.          issues -- object motion.  The first issue, basic scene design and
  58.          rendering,  is  carred  out  by  the  ray tracing program of your
  59.          choice (POV-Ray, Polyray, BOB, etc.).
  60.  
  61.          RTAG  reads  an  animation  control  file  that  you  create  and
  62.          generates  one  or  more  files  that  automate  the rendering of
  63.          individual frames and the construction of the animation sequence.
  64.          The animation control file is the focus of this manual.
  65.  
  66.          RTAG implements an animation language with a syntax similar to C.
  67.          Although simple in comparison to full featured languages such  as
  68.          C and Pascal, the RTAG language is far from trivial.  It provides
  69.          full arithmetic and logical expressions, control statements (IF),
  70.          loop  statement  (FOR,  WHILE,  and  DO),  a  rich set of library
  71.          functions (trig, log, roots, spline, etc.),  and  statements  for
  72.          writing  commands  to  the  output  files  which  will be used to
  73.          generate the frames.  Using the RTAG  language  you  can  perform
  74.          realistic    simulations    of   physical   processes   such   as
  75.          accelerations, falling objects, and interactions between objects.
  76.          RTAG also can be used as a general purpose programming language.
  77.  
  78.  
  79.          RAY TRACING DRIVER FILES
  80.  
  81.          The basic purpose of RTAG is to produce a set of files which will
  82.          cause ray tracing programs such as POV-Ray, Polyray, Vivid,  BOB,
  83.          and  other  ray tracers to generate the sequence of frames for an
  84.          animation.
  85.  
  86.          All ray tracers accept some sort of  scene  description  file  in
  87.          which  you  specify  the  position  of objects, colors, textures,
  88.          camera angle, etc.  With rare exeception, one run of a ray tracer
  89.          with one scene description produces one image file.  In order  to
  90.          produce  an  animation  you must run the ray tracer once for each
  91.          frame and vary the position of the objects and/or camera  between
  92.          frames to  produce  the  illusion of motion.  This means that the
  93.          scene  description  file  must  be  different  for  each   frame.
  94.          Fortunately,   all  good  ray  tracers  provide  a  facility  for
  95.          including one or more external files while processing  the  scene
  96.          description.   In  the  case of POV-Ray this is accomplished with
  97.          the "#include" statement.  Other tracers have similar statements.
  98.          Using this facility you can have a common scene description  file
  99.          and  place  only the commands to describe the positions of moving
  100.  
  101.                 RTAG -- Ray Tracing Animation Generator      Page 2
  102.  
  103.  
  104.          objects in a separate file that is included in the  scene.    For
  105.          example, consider this simple POV-Ray scene description file:
  106.  
  107.              #include "colors.inc"
  108.              #include "shapes.inc"
  109.              #include "move.inc"
  110.              camera {
  111.                  location <.5 1 -22> direction <0 0 1.5>
  112.                  up <0 1 0> right <1.33 0 0> look_at <0 4 0>
  113.              }
  114.              object { light_source { <6 15 -4> color White} }
  115.              object {
  116.                  sphere { <xpos ypos 0> .5}
  117.                  texture { color red .9 green 0 blue .1 ambient .8 }
  118.              }
  119.  
  120.          This scene has a camera, a single light source, and a ball.   The
  121.          position  of  the  ball  is specified as "<xpos ypos 0>" but note
  122.          that xpos and ypos are not defined in  the  file.    Rather,  the
  123.          values  of  xpos  and  ypos  are defined in a separate file named
  124.          "move.inc" that in included in this scene.  Typical statements in
  125.          move.inc are as follows:
  126.  
  127.              #declare xpos = 3
  128.              #declare ypos = 4
  129.  
  130.          To simulate motion of the  ball  you  would  prepare  a  separate
  131.          move.inc  file  for  each  frame with slightly altered values for
  132.          xpos and ypos.  Since there will be  an  include  file  for  each
  133.          frame,  they  are  typically  given  names  containing  the frame
  134.          numbers such as "MOVE001.INC", "MOVE002.INC",  etc.    A  primary
  135.          purpose  of  RTAG  is to automate the generation of these include
  136.          files.
  137.  
  138.          In addition to a scene description file and  a  separate  include
  139.          file  for each frame, you also need a DOS batch file to cause the
  140.          ray tracing program to be run for each frame.   RTAG  also  helps
  141.          you produce this file.
  142.  
  143.          For  each  frame, the batch file will contain commands to perform
  144.          the following operations: (1) make the appropriate  include  file
  145.          the   current   include  file  for  the  next  image  generation;
  146.          (2) execute the ray tracing program which will generate an  image
  147.          based  on  frame-dependent  data  in  the  current  include file;
  148.          (3) additional commands to  delete  intermediate  files  or  pack
  149.          together the  frame files.  Typical commands written to the batch
  150.          file for a frame are:
  151.  
  152.              COPY MOVE001.INC MOVE.INC
  153.              POVRAY +iMOVE.POV +oMOVE.TGA
  154.  
  155.                 RTAG -- Ray Tracing Animation Generator      Page 3
  156.  
  157.  
  158.          Rather than having RTAG produce a separate include file for  each
  159.          frame (which can end up  being  a  lot  of  files),  it  is  also
  160.          possible to write commands to the batch file to cause the include
  161.          file  to  be  created just before it is needed by the ray tracing
  162.          program.  To do this, use the  DOS  ECHO  command  with  the  ">"
  163.          redirection  operator to create the file and the ">>" operator to
  164.          add additional commands to the file.  The following is an example
  165.          of commands that create an include file named MOVE.INC, write two
  166.          commands into it, and then call POV-Ray to render the image:
  167.  
  168.              ECHO #declare xpos = 2.5 > move.inc
  169.              ECHO #declare ypos = 8.6 >> move.inc
  170.              POVRAY +iMOVE.POV +oMOVE.TGA
  171.  
  172.          Note that the ">" redirection operator creates a new file  so  it
  173.          should be  used  with the first ECHO command for each frame.  The
  174.          ">>" redirection operator appends to the end  of  a  file  so  it
  175.          should be used for additional ECHO commands for the frame.
  176.  
  177.          To  summarize,  there  are  two methods for producing the include
  178.          file for a frame: (1) have RTAG generate a separate file  with  a
  179.          unique  name  that is copied (or renamed) to the name used by the
  180.          #include statement; or (2) use ECHO commands in the batch file to
  181.          generate the include file just before invoking  the  ray  tracing
  182.          program for the frame.
  183.  
  184.  
  185.          FILES PRODUCED BY RTAG
  186.  
  187.          Include  files -- If  you  wish  to have RTAG generate a separate
  188.               include file for each frame, you must use an  OFILE  command
  189.               to declare the file name.  The name must include one or more
  190.               '#'  characters  which  are  replaced by the frame number to
  191.               generate the  actual  include  file  name.    The  NEXTFRAME
  192.               statement  increments  the  frame  number and opens the next
  193.               include file being created.  OWRITE  commands  are  used  to
  194.               write information to the currently open include file.
  195.  
  196.               If  you  create the include file by writing ECHO commands to
  197.               the batch file, then you will NOT use the OFILE  and  OWRITE
  198.               statements  which  cause RTAG to generate a separate include
  199.               file for each frame.
  200.  
  201.          Batch file -- This is a DOS  batch  (.BAT)  file  containing  the
  202.               commands to perform the following operations for each frame:
  203.               (1) make  the  appropriate  include file the current include
  204.               file for the next image generation (or generate the  include
  205.               file);  (2) execute  the  ray  tracing  program  which  will
  206.               generate an image  based  on  frame-dependent  data  in  the
  207.               current  include  file;  (3) additional  commands  to delete
  208.               intermediate files or pack together the frame  files.    Use
  209.               BWRITE statements in your control file to write to the batch
  210.               file.   The  BFILE  statement declares the name of the batch
  211.  
  212.                RTAG -- Ray Tracing Animation Generator      Page 4
  213.  
  214.  
  215.               file.  This file is not created unless you use the BFILE and
  216.               BWRITE commands.
  217.  
  218.          Auxiliary   files -- RTAG   includes   statements   for  opening,
  219.               creating, reading from,  and  writing  to  auxiliary  files.
  220.               Auxiliary input files can be used to transfer animation data
  221.               from  other programs to RTAG. One use of an auxiliary output
  222.               file is to store the names of the  generated  targa  or  GIF
  223.               files so that a subsequent program such as DTA can read this
  224.               file  to  determine  which  files  to string together in the
  225.               final animation file.
  226.  
  227.          Listing file -- This file has the  same  name  as  the  animation
  228.               control file  but  an  extension of ".LST".  It contains the
  229.               same output displayed  by  RTAG  on  the  screen  during  an
  230.               animation generation  run.    You  can  use PRINT statements
  231.               within your control file to write output to the  screen  and
  232.               the listing file.
  233.  
  234.  
  235.          AUXILIARY PROGRAMS
  236.  
  237.          RTAG  is  one  component in the set of programs needed to produce
  238.          and display an animation.  In addition to RTAG you will need  the
  239.          following programs:
  240.  
  241.          Ray  Tracing  Program -- There  are several excellent ray tracing
  242.               programs available as freeware or shareware.  Three programs
  243.               with which I am familiar  are  POV-Ray  (freeware)  by  Drew
  244.               Wells  and  the  POV  team  (CompuServe 73767,1244); Polyray
  245.               (shareware) by Alexander R. Enzmann (CompuServe 70323,2461);
  246.               and BOB by Christopher Watkins, Stephen Coy, and Mark Finlay
  247.               (included with the  excellent  book  "Photorealism  and  Ray
  248.               Tracing in C").
  249.  
  250.          GIF  generator -- Most  ray tracing programs output "targa" files
  251.               which contain higher resolution images than usually  can  be
  252.               displayed.   These targa files must be converted into GIF or
  253.               other image formats before they can be displayed.  One  fine
  254.               freeware  program  for  doing  this  is Piclab by Lee Daniel
  255.               Crocker and the Stone Soup Group (CompuServe 73407,2030).
  256.  
  257.          Scene viewer -- When designing a scene you will need a program to
  258.               display the TGA or GIF file for an individual frame  of  the
  259.               animation.  There are many programs available to do this.  A
  260.               popular  shareware  choice is CSHOW by Bob Berry (CompuServe
  261.               76555,167).
  262.  
  263.          Animation sequencer -- Once the individual frame images have been
  264.               generated, they must be combined into a single file that can
  265.               be displayed rapidly.  A shareware program which I  use  for
  266.               this is  DTA by David K. Mason (CompuServe 76546,1321).  DTA
  267.               reads the targa or GIF files produced by the ray tracer  and
  268.  
  269.                RTAG -- Ray Tracing Animation Generator      Page 5
  270.  
  271.  
  272.               produces  a  .FLI  (flick)  file that can be displayed as an
  273.               animation.
  274.  
  275.          Animation  display -- This  program  reads the finished animation
  276.               file and displays it on your screen.   A  popular  shareware
  277.               program  for  displaying .FLI files is PLAY.EXE by Trilobyte
  278.               (CompuServe 72330,3276).
  279.  
  280.          These programs, and  many  others  related  to  ray  tracing  and
  281.          animation,  are  available  in  the  libraries  of the CompuServe
  282.          GRAPHDEV forum.  This is also  an  excellent  place  for  posting
  283.          messages or getting help regarding ray tracing and animation.
  284.  
  285.          Two  bulletin boards which specialize in graphics development are
  286.          "You  Can  Call  Me  Ray,"  708-358-5611;   and   "The   Graphics
  287.          Alternative," 510-524-2780.
  288.  
  289.  
  290.          RUNNING RTAG
  291.  
  292.          Once you create an RTAG control file, you can use RTAG to compile
  293.          and execute it by issuing a DOS command of the form:
  294.  
  295.          RTAG control_file [option1] [option2]...
  296.  
  297.          where "control_file" is the name of the control file.  If no file
  298.          extension is specified, ".RTA" is used by default.
  299.  
  300.          Following  the  control  file  name  you  may specify the options
  301.          described below.  If more than one option is provided, they  must
  302.          be separated  by  spaces.    The  option  letters  are  not  case
  303.          sensitive.  Values specified with command line  options  override
  304.          the corresponding values specified in the control file.
  305.  
  306.          /B=file -- Specifies the  name of the batch file.  The batch file
  307.               name can also be specified using a BFILE statement  in  your
  308.               control file.  The default extension is ".BAT".
  309.  
  310.          /F=number -- Specifies the first frame that is to produce output.
  311.               Output  generated  with  the  BWRITE and OWRITE functions is
  312.               discarded for frames prior to  this  number.    The  default
  313.               value is 1.
  314.  
  315.          /L=number -- Specifies  the last frame that is to produce output.
  316.               Output generated with the BWRITE  and  OWRITE  functions  is
  317.               discarded for  frames  following  this  number.  By default,
  318.               there is no last frame (i.e., all frames are output).
  319.  
  320.          /N -- Specifies that no output is to be written to the batch  and
  321.               include files.    This  is  useful when you are debugging an
  322.               animation  control  file  and  want  to  test   it   without
  323.               generating the output files.  Output generated by PRINTF and
  324.               WRITE  functions  always  is written, even if this option is
  325.  
  326.                RTAG -- Ray Tracing Animation Generator      Page 6
  327.  
  328.  
  329.               specified.
  330.  
  331.          /O=file -- Specifies  the  name  of  the  include files generated
  332.               during the run.  Include file names must include the  string
  333.               '###' (1 to 5 '#' characters) which is replaced by the frame
  334.               number.   The  output file names can also be specified by an
  335.               OFILE statement in your control file.  The default extension
  336.               is ".INC".
  337.  
  338.          /P -- Causes the entire control file to be listed on  the  screen
  339.               and written  to  the  listing  file.    Normally  only error
  340.               messages and  output  generated  by  PRINTF  statements  are
  341.               displayed.
  342.  
  343.          /S=number -- Specifies  the  number of steps between frames whose
  344.               output is to be generated.  Output is discarded  for  frames
  345.               between  the  step  frames  if  a  value  other  than  1  is
  346.               specified.  The default value is 1.  If stepping is enabled,
  347.               the first frame is generated and then frames are skipped  up
  348.               to first+step.    The  sequence  continues  with  subsequent
  349.               frames.  This option is useful for producing an  abbreviated
  350.               set of frames for evaluation and debugging purposes.
  351.  
  352.          /T -- Specifies  that  each  source  statement is to be displayed
  353.               before it  is  executed.    This  is  useful  for  debugging
  354.               purposes.
  355.  
  356.  
  357.          THE RTAG ANIMATION CONTROL FILE
  358.  
  359.          RTAG  reads  an  animation control file that you create, compiles
  360.          the commands, and executes the resulting program.   The  commands
  361.          in  the  control file are formed from the RTAG animation language
  362.          which is described in the sections that follow.  However,  before
  363.          getting  into  a  detailed  discussion of the animation language,
  364.          let's look at a simple example to get a feeling for the language.
  365.          This example is a complete RTAG command file which will  generate
  366.          the  appropriate commands to move an object on a spline path that
  367.          passes through a specified set of x,y,z coordinates:
  368.  
  369.              //  Simple animation example.
  370.              //  Declare variables
  371.              var lastframe = 60;      // Generate 60 frames
  372.              var x,y,z;
  373.              //  Declare files
  374.              bfile "move";              // Batch file MOVE.BAT
  375.              //  Begin main animation loop to generate 60 frames.
  376.              while (curframe < lastframe) {
  377.                  //  Begin the next frame (this increments curframe)
  378.                  nextframe;
  379.                  //  Use spline function to compute x,y,z position.
  380.                  x = spline(curframe, 1,-8, 20,0, 40,5, 60,8);
  381.                  y = spline(curframe, 1,1,  20,5, 40,5, 60,1);
  382.  
  383.                RTAG -- Ray Tracing Animation Generator      Page 7
  384.  
  385.  
  386.                  z = spline(curframe, 1,0,  20,4, 40,6, 60,10);
  387.                  //  Report the position
  388.                  printf("At frame `curframe`, x=`x`, y=`y`, z=`z`\n");
  389.                  //  Write commands to the batch file.
  390.                  //  These commands create a move.inc include file.
  391.                  bwrite("ECHO #declare xpos = `x` > move.inc\n");
  392.                  bwrite("ECHO #declare ypos = `y` >> move.inc\n");
  393.                  bwrite("ECHO #declare zpos = `z` >> move.inc\n");
  394.                  //  Generate command to render the image.
  395.                  bwrite("call render move move`###`\n");
  396.              }
  397.              //  Write final batch command that runs DTA to build the animation.
  398.              epilog;
  399.              bwrite("call dta move\n");
  400.  
  401.  
  402.          ARITHMETIC AND LOGICAL EXPRESSIONS
  403.  
  404.          Much  of  the  power  of  RTAG  comes from its ability to perform
  405.          mathematical calculations.  This is important  for  any  type  of
  406.          animation  generation,  but  is  especially critical for physical
  407.          system simulations.    This  section  explains   the   arithmetic
  408.          operators  and  built in functions that may be used in arithmetic
  409.          expressions.
  410.  
  411.          The following arithmetic operators may be used in expressions:
  412.  
  413.              ++       add 1 to a variable
  414.              --       subtract 1 from a variable
  415.              +        addition
  416.              -        subtraction or unary minus
  417.              *        multiplication
  418.              /        division
  419.              %        modulo
  420.              ** or ^  exponentiation
  421.  
  422.          The "++" and "--" operators may be used either immediately before
  423.          or after a variable name.  If they are used before the name,  the
  424.          increment  or  decrement  is  performed  before  the value of the
  425.          variable is used in the expression.  If they are used  after  the
  426.          name,  the value of the variable before being modified is used in
  427.          the expression and then the increment or decrement  takes  place.
  428.          For example, the sequence:
  429.  
  430.              a = 3;
  431.              b = 3;
  432.              x = ++a;
  433.              y = b++;
  434.  
  435.          assigns the value 4 to x and 3 to y.  At the end of the sequence,
  436.          both a and b have the value 4.
  437.  
  438.                 RTAG -- Ray Tracing Animation Generator      Page 8
  439.  
  440.  
  441.          The following assignment operators can be used in expressions:
  442.  
  443.          variable = expression;       // Assign expression to variable
  444.          variable += expression;      // Add expression to variable
  445.          variable -= expression;      // Subtract expression from variable
  446.          variable *= expression;      // Multiply variable by expression
  447.          variable /= expression;      // Divide variable by expression
  448.  
  449.          The following operators compare two values and produce a value of
  450.          1 if the comparison is true, or 0 if the comparison is false:
  451.  
  452.              ==   Equal
  453.              !=   Not equal
  454.              <=   Less than or equal
  455.              >=   Greater than or equal
  456.              <    Less than
  457.              >    Greater than
  458.  
  459.          The following logical operators may be used:
  460.  
  461.              !    Logical NOT (negates true and false)
  462.              &&   AND
  463.              ||   OR
  464.  
  465.          There are two other special  operators:  "[]"  (square  brackets)
  466.          which enclose subscripts on arrays, and "," (comma) which is used
  467.          to  specify  left-to-right,  sequential  evaluation  of a list of
  468.          expressions.
  469.  
  470.          Operator  precedence,  in  decreasing  order,  is   as   follows:
  471.          subscript,  unary  minus,  logical NOT, ++ and --, exponentation,
  472.          multiplication, division and modulo,  addition  and  subtraction,
  473.          relational (comparison), logical (AND and OR), assignment, comma.
  474.          Parentheses may be used to group terms.
  475.  
  476.          Numeric Constants
  477.  
  478.          Numeric  constants  may  be  written in their natural form (1, 0,
  479.          1.5, .0003, etc.) or in exponential form, n.nnnEppp, where  n.nnn
  480.          is  the  base value and ppp is the power of ten by which the base
  481.          is multiplied.  For example, the number 1.5E4  is  equivalent  to
  482.          15000.   All  numbers  are  treated  as  "floating point" values,
  483.          regardless of whether a decimal point is specified or not.  As  a
  484.          convenience  for entering time values, if a value contains one or
  485.          more colons, the portion to the left of the colon  is  multiplied
  486.          by 60.    For  example,  1:00  is  equivalent  to  60; 1:00:00 is
  487.          equivalent to 3600.
  488.  
  489.                RTAG -- Ray Tracing Animation Generator      Page 9
  490.  
  491.  
  492.          Built-in Constant
  493.  
  494.          The  symbolic  name  "PI"  is  equivalent  to  the  value  of pi,
  495.          3.14159...  You may write PI using either upper or lower case.
  496.  
  497.  
  498.          Built in Functions
  499.  
  500.          The following functions are built into RTAG and may  be  used  in
  501.          expressions:
  502.  
  503.          ABS(x) -- Absolute value of x.
  504.  
  505.          ACOS(x) -- Arc cosine of x.  Angles are measured in degrees.
  506.  
  507.          ASIN(x) -- Arc sine of x.  Angles are measured in degrees.
  508.  
  509.          ATAN(x) -- Arc tangent of x.  Angles are measured in degrees.
  510.  
  511.          CEIL(x)  -- Ceiling of x (an equivalent name for this function is
  512.               INT).  Returns the smallest integer  that  is  at  least  as
  513.               large as   x.      For   example,   CEIL(1.5)=2;  CEIL(4)=4;
  514.               CEIL(-2.6)=-2.
  515.  
  516.          CLOSE(file) -- Close the specified file.
  517.  
  518.          COS(x) -- Cosine of x.  Angles are measured in degrees.
  519.  
  520.          COSH(x) -- Hyperbolic cosine of x.
  521.  
  522.          COT(x) -- Cotangent of x. (COT(x) = 1/TAN(x)).  Angle in degrees.
  523.  
  524.          CREATE("file name") -- Create a new auxiliary  data  file.    The
  525.               value returned by this function is a file number that can be
  526.               used with  subsequent  WRITE functions.  See the description
  527.               of auxiliary file I/O for additional information.
  528.  
  529.          CSC(X) -- Cosecant of x. (CSC(x) = 1/SIN(x)).  Angle in degrees.
  530.  
  531.          DEG(x) -- Converts an  angle,  x,  measured  in  radians  to  the
  532.               equivalent number of degrees.
  533.  
  534.          EXP(x) -- e (base of natural logarithms) raised to the x power.
  535.  
  536.          FAC(x) --  x  factorial (x!).  The FAC function is computed using
  537.               the  GAMMA  function  (FAC(x)=GAMMA(x+1))   so   non-integer
  538.               argument values may be computed.
  539.  
  540.          FLOOR(x) -- Floor of x.  Returns the largest integer that is less
  541.               than or  equal to x.  For example, FLOOR(2.5)=2; FLOOR(4)=4;
  542.               FLOOR(-3.6)=-4.
  543.  
  544.                RTAG -- Ray Tracing Animation Generator      Page 10
  545.  
  546.  
  547.          GAMMA(x) -- Gamma function.  Note, GAMMA(x+1) = x! (x factorial).
  548.  
  549.          INT(x)  --  Ceiling of x (an equivalent name for this function is
  550.               CEIL).  Returns the smallest integer that  is  at  least  as
  551.               large as    x.      For   example,   INT(1.5)=2;   INT(4)=4;
  552.               INT(-2.6)=-2.
  553.  
  554.          LINEAR(t,  t1,x1,   t2,x2,   ...   tn,xn)   --   Perform   linear
  555.               interpolation between  a  set  of points.  If the value of a
  556.               function is x1 at some  point  t1,  x2  at  t2,  etc.,  this
  557.               function  determines  the  value at some arbitrary point, t,
  558.               where t falls in the range (t1,tn).  The first  argument  to
  559.               the   LINEAR   function   is   the  value  t  at  which  the
  560.               interpolation is to be performed.  The  remaining  arguments
  561.               are (ti,xi)  data pairs.  For example, consider the function
  562.               LINEAR(t, 0,0, 1,6, 2,4).  This specifies that when t is  0,
  563.               the value of the function is 0, when t is 1, the value is 6,
  564.               and when  t is 2 the value is 4.  If this function is called
  565.               with a t value of 0.5, the returned value  of  the  function
  566.               will be 3.  If the function is called with a t value of 1.5,
  567.               the returned  value  will  be 5.  You can use expressions as
  568.               arguments to this function.    For  example,  the  following
  569.               function  invocation  is  valid:  LINEAR(t, starttime,basex,
  570.               starttime+3,midx, endtime,midx*2).    If  the  function   is
  571.               called  with  a  t  value  that is outside the range (t1,tn)
  572.               (i.e., beyond either end point), then the nearest end  point
  573.               and  the second closest point are used to extrapolate to the
  574.               specified t value.  See also the description of  the  SPLINE
  575.               function.
  576.  
  577.          LOG(x) -- Natural logarithm of x.
  578.  
  579.          LOG10(x) -- Base 10 logarithm of x.
  580.  
  581.          MAX(x1,x2) -- Maximum value of x1 or x2.
  582.  
  583.          MIN(x1,x2) -- Minimum value of x1 or x2.
  584.  
  585.          MOD(x1,x2) --  x1  modulo  x2.    The MOD function calculates the
  586.               floating-point  remainder,  f,  of   x1/(i*x2)   such   that
  587.               x1=i*x2+f, where i is an integer; f has the same sign as x1,
  588.               and  the absolute value of f is less than the absolute value
  589.               of x2.  The % operator perform the same operation.
  590.  
  591.          MOREDATA(file) -- This function checks to see if there is another
  592.               data record available in the external file whose file number
  593.               is specified  as  the  argument.    If  there  is  a  record
  594.               available, this function returns the value true (1), if not,
  595.               it returns  false  (0).   This function does not consume any
  596.               data in the  file,  you  must  use  the  READ  statement  to
  597.               actually read  the  next  record.  You can call MOREDATA any
  598.               number of times without disturbing the next  record  in  the
  599.               file.   See the section on auxiliary file I/O for additional
  600.  
  601.                RTAG -- Ray Tracing Animation Generator      Page 11
  602.  
  603.  
  604.               information.
  605.  
  606.          NPD(x,mean,std)  --  Normal  probability  distribution  of x with
  607.               specified mean and standard deviation.  X  is  in  units  of
  608.               standard deviations from the mean.
  609.  
  610.          OPEN("file name")  --  Open  an  existing  file for reading.  The
  611.               value returned by this function is a file number that can be
  612.               used with subsequent READ functions.  See the description of
  613.               auxiliary file I/O for additional information.
  614.  
  615.          PAREA(x) -- Area under the normal probability distribution  curve
  616.               from  -infinity to x. (i.e., integral from -infinity to x of
  617.               NORMAL(x)).
  618.  
  619.          PRINTF("format"[,expression1,expression2,...])  --  Evaluate  the
  620.               expressions (if any) and write the values with the specified
  621.               formatting string to the console and the listing file.
  622.  
  623.          PULSE(a,x,b) -- Pulse function.  If the value of x is less than a
  624.               or greater  than b, the value of the function is 0.  If x is
  625.               greater than or equal to a and less than or equal to b,  the
  626.               value of the function is 1.  In other words, it is 1 for the
  627.               domain (a,b)  and  zero  elsewhere.   If you need a function
  628.               that is zero in the domain (a,b) and 1  elsewhere,  use  the
  629.               expression (1-PULSE(a,x,b)).
  630.  
  631.          RAD(x) -- Converts an angle measured in degrees to the equivalent
  632.               number of radians.
  633.  
  634.          RANDOM()  --  Returns a random value uniformly distributed in the
  635.               range 0 to 1.  You can use  the  srand  system  variable  to
  636.               specify a starting seed.
  637.  
  638.          READ(file,variable1,variable2,...)  --  Read  one  line  from the
  639.               specified file, scan the input line for values,  and  assign
  640.               the values to the specified variables.
  641.  
  642.          ROUND(x) --  Rounds  x  to  the  nearest  integer.   For example,
  643.               ROUND(1.1)=1; ROUND(1.8)=2; ROUND(-2.8)=-3;
  644.  
  645.          SEC(x) -- Secant of x. (SEC(x) = 1/COS(x)).  Angle in degrees.
  646.  
  647.          SEL(a1,a2,v1,v2) -- If a1 is less than a2 then the value  of  the
  648.               function is  v1.  If a1 is greater than or equal to a2, then
  649.               the value of the function is v2.
  650.  
  651.          SIN(x) -- Sine of x.  Angles are measured in degrees.
  652.  
  653.          SINH(x) -- Hyperbolic sine of x.
  654.  
  655.                RTAG -- Ray Tracing Animation Generator      Page 12
  656.  
  657.  
  658.          SPLINE(t, t1,x1, t2,x2, ... tn,xn)  --  Perform  a  cubic  spline
  659.               interpolation between a set of points.  A spline is a smooth
  660.               path (continuous first and second derivatives)  that  passes
  661.               through a set of points.  The SPLINE function is very useful
  662.               in  animations  because  it allows you to easily construct a
  663.               smooth path for the motion of some object (or the camera).
  664.  
  665.               If the value of a function is x1 at some point t1, x2 at t2,
  666.               etc., this function determines the value at  some  arbitrary
  667.               point, t,  where  t  falls  in the range (t1,tn).  The first
  668.               argument to the SPLINE function is the value t at which  the
  669.               interpolation is  to  be performed.  The remaining arguments
  670.               are (ti,xi)  data  pairs.    You  can  use  expressions   as
  671.               arguments to  this  function.    For  example, the following
  672.               function invocation  is  valid:  SPLINE(t,  starttime,basex,
  673.               starttime+3,midx, endtime,midx*2).     If  the  function  is
  674.               called with a t value that  is  outside  the  range  (t1,tn)
  675.               (i.e.,  beyond  either  end  point),  then  the value of the
  676.               function at the nearest end  point  and  the  slope  of  the
  677.               function  at  that point are used to extrapolate in a linear
  678.               fashion to the specified t value.  See also the  description
  679.               of the LINEAR function.
  680.  
  681.          SQRT(x) -- Square root of x.
  682.  
  683.          STEP(a,x) --  Step  function.   If x is less than a, the value of
  684.               the function is 0.  If x is greater than or equal to a,  the
  685.               value of the function is 1.  If you need a function which is
  686.               1  up  to  a certain value and then 0 beyond that value, use
  687.               the expression STEP(x,a).
  688.  
  689.          TAN(x) -- Tangent of x.  Angles are measured in degrees.
  690.  
  691.          TANH(x) -- Hyperbolic tangent of x.
  692.  
  693.          WRITE(file,"format"[,expression1,expression2,...])  --   Evaluate
  694.               the  expressions  (if  any)  and  write  the values with the
  695.               specified formatting string to auxiliary output  file  whose
  696.               file number is specified as the first argument.
  697.  
  698.  
  699.          NOTES ON THE SPLINE AND LINEAR FUNCTIONS
  700.  
  701.          RTAG includes two library functions for performing interpolation:
  702.          LINEAR  and  SPLINE. If you have two pairs of values, (t1,x1) and
  703.          (t2,x2),  these  functions  determine  the  value   of   x   that
  704.          corresponds to  some  value  of t between t1 and t2.  If you have
  705.          more than two pairs, the function determines the value of x  that
  706.          is on the segment that spans the specified value of t.
  707.  
  708.          The  function  parameters,  t  and  x,  can represent any type of
  709.          value.  However, in animations t is usually a time value or frame
  710.          number, and x is a position (either in the X, Y, or Z dimension).
  711.  
  712.                RTAG -- Ray Tracing Animation Generator      Page 13
  713.  
  714.  
  715.          If you want an object to follow a path through  a  set  of  three
  716.          dimensional points, you have to use three statements,  each  with
  717.          an interpolation  function.   For example, if at frame 1 you want
  718.          an object to be at (-8,0,-3), frame 20 to be at  (0,5,-1),  frame
  719.          40  to  be  at  (2,2,0),  and frame 60 to be at (7,4,2), then you
  720.          could use the following statements:
  721.  
  722.              while (curframe <= 60) {
  723.                  nextframe;
  724.                  x = spline(curframe, 1,-8, 20,0,  40,2, 60,7);
  725.                  y = spline(curframe, 1,0,  20,5,  40,2, 60,4);
  726.                  z = spline(curframe, 1,-3, 20,-1, 40,0, 60,2);
  727.                  << other statements >>
  728.              }
  729.  
  730.          The spline function will force the object to be at the  specified
  731.          x,y,z  coordinate  at frames 1, 20, 40, and 60, and will generate
  732.          intermediate positions between these frames.
  733.  
  734.          While the method explained above  of  specifying  absolute  frame
  735.          numbers  works  well,  you  will have to change the values in the
  736.          function specification if you change the total number  of  frames
  737.          in the  animation.  A better approach is to use the percentage of
  738.          the total animation as the control values and use the  expression
  739.          (100*(curframe-1)/(lastframe-1))  to  specify  the position along
  740.          the path.  Note that the a value must be specified for lastframe.
  741.          The following program illustrates this approach:
  742.  
  743.              var x,y,z,position;
  744.              var lastframe = 50;     // Animation will have 50 frames
  745.              while (curframe < lastframe) {
  746.                  nextframe;          // This increments curframe
  747.                  position = 100*(curframe-1)/(lastframe-1);
  748.                  x = spline(position, 0,-8, 40,0,  60,2, 100,7);
  749.                  y = spline(curframe, 0,0,  40,5,  60,2, 100,4);
  750.                  z = spline(curframe, 0,-3, 40,-1, 60,0, 100,2);
  751.              << statements to output position >>
  752.              }
  753.  
  754.          If the path described by a spline  function  completes  a  closed
  755.          circuit,  a smoother transition can be accomplished by specifying
  756.          an extra point beyond either end which matches the next point  on
  757.          the path.  The following statements illustrate this for forming a
  758.          roughly  circular  path  (a better way to do this would be to use
  759.          sin and cos functions):
  760.  
  761.              position = 100*(curframe-1)/(lastframe-1);
  762.              x = spline(position, -20,0.3,   0,1.0,   20,0.3,  40,-0.8,
  763.                                    60,-0.8, 80,0.3,  100,1.0, 120,0.3);
  764.              y = spline(position, -20,-1.0,  0,0.0,   20,1.0,  40,0.6,
  765.                                    60,-0.6, 80,-1.0, 100,0.0, 120,1.0);
  766.  
  767.                RTAG -- Ray Tracing Animation Generator      Page 14
  768.  
  769.  
  770.          Note that the first point specified  (-20)  and  the  last  point
  771.          (120) will never be reached since the value  of  position  ranges
  772.          from 0  to 100.  However, because the spline function depends not
  773.          only on the current position but also on  the  points  on  either
  774.          side, specifying these points smooths out the transition near the
  775.          end points.   This trick does not apply to spline curves that are
  776.          not closed on themselves.
  777.  
  778.  
  779.          THE ANIMATION CONTROL LANGUAGE
  780.  
  781.          The RTAG animation control language is similar  to  other  modern
  782.          programming  languages  such as C. It provides the tools you need
  783.          to  easily  perform  animation  simulations  and   generate   the
  784.          necessary  output  files  to  drive the ray tracing and auxiliary
  785.          programs.
  786.  
  787.  
  788.          COMMENTS
  789.  
  790.          The beginning of a comment is denoted with "//" (two  consecutive
  791.          slash characters).   Everything from the "//" sequence to the end
  792.          of the line is treated as a comment.  Comments may be on lines by
  793.          themselves or on the ends of other  statements.    You  can  also
  794.          specify  a  comment  by  beginning  the  comment  with  the  "/*"
  795.          character sequence.  All characters following this are treated as
  796.          comments up to the matching "*/" sequence.  The  following  lines
  797.          illustrate both types of comments:
  798.  
  799.              //  Begin main simulation loop
  800.              y = y + timestep * yvelocity;  //  Advance y position
  801.              /*
  802.               *  This is a comment.
  803.               */
  804.              z = y / 5;                  /* This is a comment too */
  805.  
  806.  
  807.          BASIC STATEMENT SYNTAX
  808.  
  809.          The  RTAG  language  has  a  syntax  that  is  very similar to C:
  810.          statements are terminated with a semicolon, and brace  characters
  811.          ("{" and "}") are used to group statements.
  812.  
  813.  
  814.  
  815.          DECLARATION OF VARIABLES (The VAR Statatement)
  816.  
  817.          All  variables  used  in  your  animation  control  file  must be
  818.          declared before they are used.    This  is  done  using  the  VAR
  819.          statement  which  may  optionally  assign an initial value to the
  820.          variable.  If no  initial  value  is  specified,  0  is  used  by
  821.          default.   VAR  is  a declarative statement: that is, it declares
  822.          the existance of the variable and assigns an  initial  value,  it
  823.  
  824.                RTAG -- Ray Tracing Animation Generator      Page 15
  825.  
  826.  
  827.          does  not reassign the value to the variable if the VAR statement
  828.          appears in a loop.
  829.  
  830.          Variable names  may  be  up to 30 characters long.  They ARE case
  831.          sensitive.  Keywords (FOR, WHILE, VAR, etc.) and library function
  832.          names (SIN,  COS,  ABS,  etc.)  are  NOT  case  sensitive.    All
  833.          variables are double precision (64 bit) floating point values.
  834.  
  835.          The syntax of the VAR statement is:
  836.  
  837.              VAR variable1[=value], variable2[=value], ...;
  838.  
  839.          You may  use  as  many VAR statements as you need.  The following
  840.          are examples of this statement:
  841.  
  842.              var x, y, speed = 5;
  843.              var Acceleration = 2.5;
  844.  
  845.          In addition to simple scalar variables, RTAG also allows  you  to
  846.          use one-dimensional   array  variables.    To  declare  an  array
  847.          variable, follow the name of the  variable  with  the  number  of
  848.          elements enclosed in square brackets.  For example, the following
  849.          command  declares  a  variable  named  speeds  that  will have 20
  850.          values:
  851.  
  852.              var speeds[20];
  853.  
  854.          If you wish to assign initial values to  an  array,  enclose  the
  855.          list of values in braces.  For example,
  856.  
  857.              var xpos[3] = {1.2, 2.7, 4.6};
  858.  
  859.          Subscripts follow  the  C  convention of being 0 based.  That is,
  860.          the first element of an array is  referenced  using  a  subscript
  861.          value of  0.    For  example,  if the variable x is declared with
  862.          three elements (var x[3]) then the elements would  be  referenced
  863.          as x[0], x[1], and x[2].  The expression x[3] would NOT be valid.
  864.  
  865.          In  addition  to your own variables, RTAG provides several system
  866.          variables.  If you  do  not  provide  VAR  statements  for  these
  867.          variables,  they  are defined automatically at the start of a run
  868.          and RTAG assigns their values.
  869.  
  870.           Variable   Default               Meaning
  871.          ----------  -------  -------------------------------------------
  872.          curframe       0     The current frame number. Set by NEXTFRAME.
  873.          firstframe     1     The first frame that will generate output.
  874.          lastframe    999999  The last frame that will generate output.
  875.          stepinc        1     The step increment between frames.
  876.          srand          1     Seed for random number generator.
  877.  
  878.          These variables may be used in your animation control  file  just
  879.          like ordinary  variables.    If you want to set different default
  880.  
  881.                RTAG -- Ray Tracing Animation Generator      Page 16
  882.  
  883.  
  884.          values for firstframe, lastframe, stepinc or  srand,  use  a  VAR
  885.          statement and  specify  an  initial  value.    For  example,  the
  886.          following commands would cause frames 20 through 40 to be output:
  887.  
  888.              var firstframe = 20;
  889.              var lastframe = 40;
  890.  
  891.          The  default  values,  or the values specified by VAR statements,
  892.          can be overridden by qualifiers on  the  command  line.  /F  sets
  893.          firstframe, /L sets lastframe, and /S sets stepinc.
  894.  
  895.          The  srand system variable is used to set a starting "seed" value
  896.          for the RANDOM() function.  The default value  for  srand  is  1.
  897.          For  a  given  starting  seed value, the pseudorandom sequence is
  898.          always the same.
  899.  
  900.  
  901.          OUTPUT FILE DECLARATIONS
  902.  
  903.          RTAG is capable of producing  multiple  files  during  each  run.
  904.          Most of these files are optional and will only be produced if you
  905.          include the appropriate statements in your control file.
  906.  
  907.          The listing file is always produced.  It has the same name as the
  908.          animation control file but with an extension of ".LST".
  909.  
  910.          Most RTAG runs will produce a batch file to drive the ray tracing
  911.          program.   The  batch  file  may contain commands to generate the
  912.          appropriate include file for each frame or you may choose to have
  913.          RTAG generate the full set of include  files  separate  from  the
  914.          batch file.   If you wish to generate a batch file you must place
  915.          a command of the following form in your control file:
  916.  
  917.              BFILE "name";
  918.  
  919.          where 'name' is  the  name  of  the  batch  file.    The  default
  920.          extension is ".BAT".  Note that the file name must be enclosed on
  921.          quote marks.
  922.  
  923.          The batch file normally contains a set of commands to render each
  924.          frame.   Typically,  the  commands  for  each  frame  perform the
  925.          following actions:
  926.  
  927.             1. Generate an include file with object position information.
  928.             2. Run the ray tracer using the current include file.
  929.  
  930.          The BWRITE function is used to write to  the  batch  file.    The
  931.          batch  file  is optional and is generated only if you use a BFILE
  932.          statement.
  933.  
  934.                RTAG -- Ray Tracing Animation Generator      Page 17
  935.  
  936.  
  937.          If you wish to have RTAG generate a set  of  include  files,  you
  938.          must use the following command to declare the names of the files:
  939.  
  940.              OFILE "name";
  941.  
  942.          If the OFILE statement is used, one output file is generated  for
  943.          each frame.  The output file name must include a string of one to
  944.          seven '#'  characters.    These  characters  are  replaced by the
  945.          current frame number when the  file  is  opened.    For  example,
  946.          consider the following command:
  947.  
  948.          ofile "bounc###.inc";
  949.  
  950.          Then  for  frame  27  the  name  of  the  created  file  will  be
  951.          BOUNC027.INC. The default extension is  ".INC".    The  NEXTFRAME
  952.          command  closes  the  current  output  file, increments the frame
  953.          number, and opens  the  next  output  file  (assuming  the  OFILE
  954.          statement was  specified).    The last output file is closed when
  955.          the program stops.  The  OWRITE  function  writes  lines  to  the
  956.          currently open output file.
  957.  
  958.          RTAG can  also create or read from auxiliary data files.  This is
  959.          described in a subsequent section.
  960.  
  961.  
  962.          ASSIGNMENT STATEMENT
  963.  
  964.          The  assignment  statement  is  an  executable   statement   that
  965.          evaluates an expression and assigns its value to a variable.  The
  966.          syntax for an assignment statement is:
  967.  
  968.          variable = expression;       // Assign expression to variable
  969.          variable += expression;      // Add expression to variable
  970.          variable -= expression;      // Subtract expression from variable
  971.          variable *= expression;      // Multiply variable by expression
  972.          variable /= expression;      // Divide variable by expression
  973.  
  974.          where  "variable"  is a previously declared variable which may be
  975.          subscripted and "expression" is a  valid  arithmetic  or  logical
  976.          expression following   the  rules  explained  earlier.    If  the
  977.          expression involves a relational comparison operator (e.g., <, >,
  978.          >=, etc.) or a logical operation (&&, ||, !), the value 1 is used
  979.          for true and 0 for false.
  980.  
  981.                RTAG -- Ray Tracing Animation Generator      Page 18
  982.  
  983.  
  984.          IF STATEMENT
  985.  
  986.          The form of the IF statement is:
  987.  
  988.              IF (expression) statement1 [ELSE statement2]
  989.  
  990.          If  the  expression is true (not zero) statement1 is executed, if
  991.          the expression is false (0) and the  ELSE  clause  is  specified,
  992.          statement2 is  executed.    The ELSE clause and the second set of
  993.          controlled statements are optional.  You may  control  groups  of
  994.          statements by  enclosing  them  in  braces.    The  following are
  995.          examples of valid IF statements:
  996.  
  997.              if (x > bigx) bigx = x;
  998.  
  999.              if (x <= 10) {
  1000.                  y = linear(x, 0,0, 10,6);
  1001.                  z = .5 * x;
  1002.              } else {
  1003.                  y = y + yspeed * timestep;
  1004.                  z = .3 * x;
  1005.              }
  1006.  
  1007.  
  1008.          WHILE STATEMENT
  1009.  
  1010.          The  WHILE  statement  loops  until  the  controlling  expression
  1011.          becomes  false  (0)  or  a BREAK statement is executed within the
  1012.          loop.  The form of the WHILE statement is:
  1013.  
  1014.              WHILE (expression) {
  1015.                  << controlled statements >>
  1016.              }
  1017.  
  1018.          Each time around the loop the expression is evaluated.  If it  is
  1019.          true  (non  zero) the controlled statements are executed and then
  1020.          the process repeats until the expression becomes  false.    If  a
  1021.          BREAK  statement  is  executed  within the loop, execution of the
  1022.          loop terminates and control is transferred to the first statement
  1023.          beyond the end of the loop.  If a CONTINUE statement is  executed
  1024.          in  the  loop,  control is transferred to the conditional test at
  1025.          the top of the loop.  The following is  an  example  of  a  WHILE
  1026.          statement:
  1027.  
  1028.              while (x < 5) {
  1029.                  x = x + xmove;
  1030.                  y = y + ymove;
  1031.              }
  1032.  
  1033.                RTAG -- Ray Tracing Animation Generator      Page 19
  1034.  
  1035.  
  1036.          DO STATEMENT
  1037.  
  1038.          The DO statement is very similar to the  WHILE  statement  except
  1039.          the control expression is evaluated at the end of the loop rather
  1040.          than the  beginning.   This causes the loop always to be executed
  1041.          at least once.  The form of the DO statement is:
  1042.  
  1043.              DO {
  1044.                  << controlled statements >>
  1045.              WHILE (expression);
  1046.  
  1047.          For each iteration of the  loop  the  controlled  statements  are
  1048.          executed and then the conditional expression is evaluated.  If it
  1049.          is  true  (non-zero)  control  transfers  to the first controlled
  1050.          statement at the top of the loop.  A BREAK statement may be  used
  1051.          to  terminate  the  loop  before  the  conditional  expression is
  1052.          evaluated.  A CONTINUE statement can be used to cause control  to
  1053.          be  transferred  from  within  the  loop  to  the point where the
  1054.          conditional expression is evaluated.  The following is an example
  1055.          of a DO statement:
  1056.  
  1057.              do {
  1058.                 read(infile,lastflag,x[numpoints++]);
  1059.              } while (!lastflag);
  1060.  
  1061.  
  1062.          FOR STATEMENT
  1063.  
  1064.          The FOR statement is a looping control statement similar  to  the
  1065.          WHILE  statement;  however,  the FOR statement also allows you to
  1066.          specify initialization expressions that are executed once at  the
  1067.          beginning of the loop, and loop-end expressions that are executed
  1068.          at the end of each loop cycle.  The form of the FOR statement is:
  1069.  
  1070.              FOR (expression1; expression2; expression3) statement
  1071.  
  1072.          Execution of a FOR statement proceeds as follows:
  1073.  
  1074.          1.  Evaluate expression1.  Typically this expression will include
  1075.          assignment  operators  ("=")  to  set  initial  values  for  loop
  1076.          variables.  If you need more than one initial expression, specify
  1077.          them as a list separated by commas.
  1078.  
  1079.          2.  Evaluate expression2.  If its value is  false  (0)  terminate
  1080.          the  FOR  statement  and  transfer  control to the statement that
  1081.          follows the  controlled  statement.    If  expression2  is  true,
  1082.          proceed to the next step.
  1083.  
  1084.          3.  Execute the controlled statement.  If more than one statement
  1085.          is  to  be  controlled,  enclose  them with brace characters ("{"
  1086.          "}").
  1087.  
  1088.                RTAG -- Ray Tracing Animation Generator      Page 20
  1089.  
  1090.  
  1091.          4.  Evaluate expression3.  This expression will typically contain
  1092.          operators  such  as "++", "+=", "--", or "-=" to modify the value
  1093.          of a loop variable.
  1094.  
  1095.          5.  Transfer control to step 2, where expression2 is  once  again
  1096.          evaluated.
  1097.  
  1098.          The following is an example of a FOR statement:
  1099.  
  1100.              for (time=starttime; time<endtime; time+=timestep) {
  1101.                  << controlled statements >>
  1102.              }
  1103.  
  1104.  
  1105.          BREAK STATEMENT
  1106.  
  1107.          The  BREAK  statement  can be used in FOR, WHILE, and DO loops to
  1108.          terminate the loop and cause control to transfer to the statement
  1109.          beyond the end of the loop.  The following is  an  example  of  a
  1110.          BREAK statement:
  1111.  
  1112.              time = 0;
  1113.              x = 0;
  1114.              while (time < endtime) {
  1115.                  x += delta * xspeed;
  1116.                  if (x > 10) break;
  1117.              }
  1118.  
  1119.  
  1120.          CONTINUE STATEMENT
  1121.  
  1122.          The CONTINUE statement can be used in FOR, WHILE, and DO loops to
  1123.          terminate the  current  iteration  and  begin the next one.  When
  1124.          CONTINUE is executed in a  WHILE  or  DO  statement,  control  is
  1125.          transferred  to  the  point  in  the  loop where the loop control
  1126.          expression is evaluated.  When CONTINUE  is  executed  in  a  FOR
  1127.          statement, control is transferred to the bottom of the loop where
  1128.          expression3  is  evaluated (which normally augments the values of
  1129.          the loop variables for the next iteration).
  1130.  
  1131.  
  1132.          STOP STATEMENT
  1133.  
  1134.          The STOP statement terminates the execution of  RTAG  and  closes
  1135.          all output  files.  An implicit STOP occurs if you "fall through"
  1136.          the bottom of your animation control file.  The following  is  an
  1137.          example of the STOP statement:
  1138.  
  1139.              while (curframe < 60) {
  1140.                  << controlled statements >>
  1141.                  if (xposition1 >= xposition2) stop;
  1142.              }
  1143.  
  1144.                RTAG -- Ray Tracing Animation Generator      Page 21
  1145.  
  1146.  
  1147.          WRITE STATEMENTS
  1148.  
  1149.          RTAG has three functions for writing output  to  standard  files.
  1150.          These functions and the files they write to are as follows:
  1151.  
  1152.              PRINTF -- Listing file (also displayed on screen).
  1153.              OWRITE -- Output file (OFILE).
  1154.              BWRITE -- Batch file (BFILE).
  1155.  
  1156.          Since  the  form  for these functions is the same (except for the
  1157.          keyword), the PRINTF statement will be used in the illustrations.
  1158.          The form of the function is:
  1159.  
  1160.          printf("string"[,expression1, expression2,...])
  1161.  
  1162.          where "string"  is  a  quoted  text  string  that  may  including
  1163.          variable and expression replacement operators.  You can cause the
  1164.          current  value  of  a variable to be substituted into a string by
  1165.          inserting the  variable  name  in  the  string  enclosed  by  "`"
  1166.          characters.   Note,  this is not the apostrophe, it is the accent
  1167.          character that is on the same key as the tilde on most keyboards.
  1168.          You can use the SUBCHAR  statement  (see  below)  to  change  the
  1169.          character used  to  mark  a  variable  value  substitution.   For
  1170.          example, the following statement prints the values  of  the  xpos
  1171.          and ypos variables:
  1172.  
  1173.          printf("X position is `xpos`, and Y position is `ypos`\n");
  1174.  
  1175.          When this statement is executed `xpos` and `ypos` are replaced by
  1176.          the current values of the xpos and ypos variables.
  1177.  
  1178.          Following  the  C  model,  control  characters  are placed in the
  1179.          string by  prededing  the  character  with  a  backslash.     The
  1180.          following table indicates each of the valid control sequences:
  1181.  
  1182.            \a -- Bell character (0x07).
  1183.            \b -- Backspace (0x08).
  1184.            \f -- Form feed (0x0C);
  1185.            \n -- End of print line (carriage-return, line-feed).
  1186.            \r -- Carriage return only.
  1187.            \" -- Quote character.
  1188.            \\ -- Literal backslash character (i.e., replace "\\" with "\").
  1189.            \xddd -- Hexadecimal value 0xddd.
  1190.  
  1191.          If  the  sequence  `###`  (1  to 7 '#' characters enclosed by "`"
  1192.          characters) appears in the string, the pound signs  are  replaced
  1193.          by the  current frame number with leading zeros.  If the sequence
  1194.          `+++` (1 to 7 '+' characters) appears in  the  string,  the  plus
  1195.          signs  are  replaced by a value equal to the current frame number
  1196.          plus 1.   In  addition,  the  strings  `ofile`  and  `bfile`  are
  1197.          replaced  by  the  names  of  the  output  file,  and  batch file
  1198.          respectively.  The string `file` is replaced by the name  of  the
  1199.          input  animation  command  file  with  any device, directory, and
  1200.  
  1201.                RTAG -- Ray Tracing Animation Generator      Page 22
  1202.  
  1203.  
  1204.          extension removed.
  1205.  
  1206.          You can  also  substitute the values of expressions.  To do this,
  1207.          use the C programming notation "%w.dlf" where 'w' is the  overall
  1208.          field width  and  'd'  is  the  number  of  decimal  places.  For
  1209.          example,  the  following  statement  prints  the  value   of   an
  1210.          expression:
  1211.  
  1212.          printf("The diagonal distance is %5.1lf\n", sqrt(xd^2 + yd^2));
  1213.  
  1214.  
  1215.          SUBCHAR STATEMENT
  1216.  
  1217.          The  SUBCHAR statement specifies which character is to be used in
  1218.          write strings to enclose the names of variables whose values  are
  1219.          to be substituted in the string.  The default character is "`" --
  1220.          the  accent  character  which  is  usually on the same key as the
  1221.          tilde character.  The form of the statement is:
  1222.  
  1223.          SUBCHAR "char";
  1224.  
  1225.          where "char" is a single character that must be included in quote
  1226.          marks.  For example, the following statement declares dollar sign
  1227.          to be the substitution marker character:
  1228.  
  1229.              subchar "$";
  1230.  
  1231.  
  1232.          NEXTFRAME STATEMENT
  1233.  
  1234.          The NEXTFRAME statement performs the following actions: (1) close
  1235.          the currently open output file, if any; (2) increment the current
  1236.          frame number (and curframe variable); (3) if an  OFILE  statement
  1237.          was  used,  open  a new output file with the current frame number
  1238.          substituted for the "###" characters in the file name.
  1239.  
  1240.          You must execute a NEXTFRAME statement  before  you  can  use  an
  1241.          OWRITE function.    PRINT,  BWRITE  and  WRITE  functions  can be
  1242.          executed before the first NEXTFRAME command.    The  last  output
  1243.          file is closed when your program stops.
  1244.  
  1245.  
  1246.          EPILOG STATEMENT
  1247.  
  1248.          The EPILOG statement (which may also be spelled EPILOGUE) informs
  1249.          RTAG  that  the last frame has been completed and that subsequent
  1250.          BWRITE function calls  are  unconditionally  to  generate  output
  1251.          regardless  of  the  setting  of  the  firstframe, lastframe, and
  1252.          stepinc values.   Otherwise  BWRITE  functions  do  not  generate
  1253.          output  if  they occur after the last frame, or between frames if
  1254.          stepinc is not 1.  Commonly statements using the BWRITE  function
  1255.          are   used   after   EPILOG  to  write  some  "end-of-all-frames"
  1256.          termination statements to the batch file, such as commands to run
  1257.  
  1258.                RTAG -- Ray Tracing Animation Generator      Page 23
  1259.  
  1260.  
  1261.          DTA to build the animation sequence.
  1262.  
  1263.  
  1264.          SELF-CONTINUING BATCH FILES
  1265.  
  1266.          Because  so  much  computer time is required to create ray traced
  1267.          animations, it is sometimes necessary to produce the frames using
  1268.          a series of runs rather than in a single run.  Using RTAG  it  is
  1269.          easy  to  produce  BAT files that automatically will restart with
  1270.          the first frame that does not exist.  This is done by  generating
  1271.          "IF EXIST...GOTO"  commands  as part of the batch file.  For each
  1272.          frame you cause the BAT file to check if the TGA file exists;  if
  1273.          so, control  skips  to the test for the next file.  The following
  1274.          is a skeleton of an RTAG program to  generate  these  statements.
  1275.          Note  the  use  of  the  `###` sequence to substitute the current
  1276.          frame number and the `+++` sequence to substitute the next  frame
  1277.          number.
  1278.  
  1279.              while (curframe < lastframe) {
  1280.                  nextframe;
  1281.                  bwrite(":do`###`\n");
  1282.                  bwrite("if exist tour`###`.tga goto do`+++`\n");
  1283.                  << other commands to write info for this frame >>
  1284.              }
  1285.              epilog;
  1286.              bwrite(":do`+++`\n");
  1287.              bwrite("call dodta TOUR /S8\n");
  1288.  
  1289.          The  commands  written  to  the  BAT file for each frame have the
  1290.          following form:
  1291.  
  1292.              :do001
  1293.              if exist tour001.tga goto do002
  1294.              << commands to generate frame 1 >>
  1295.              :do002
  1296.              if exist tour002.tga goto do003
  1297.              << commands to generate frame 2 >>
  1298.              :do003
  1299.  
  1300.  
  1301.          AUXILIARY DATA FILES
  1302.  
  1303.          RTAG provides functions to open, close, read from, and  write  to
  1304.          auxiliary data  files.   This is useful if some other program has
  1305.          computed  object  positions  or  other  data  that  affects   the
  1306.          animation.
  1307.  
  1308.          Up to 30 auxiliary data files can be open at once.  The files are
  1309.          identified  by  numbers  (also  called  file  "handles") that are
  1310.          assigned by RTAG at the time that the file is opened.   The  file
  1311.          numbers can  be  reused by closing and reopening files.  You must
  1312.          use the VAR statement to  declare  variables  to  hold  the  file
  1313.          numbers.
  1314.  
  1315.                RTAG -- Ray Tracing Animation Generator      Page 24
  1316.  
  1317.  
  1318.  
  1319.          Opening a File for Reading
  1320.  
  1321.          The form of the statement used  to  open  an  existing  file  for
  1322.          reading is:
  1323.  
  1324.               variable = open("file name");
  1325.  
  1326.          where 'variable' is a varible you have previously declared with a
  1327.          VAR statement.    When  RTAG opens the file it generates a unique
  1328.          file number and assignes it to the variable on the  left  of  the
  1329.          equal sign.    This  file number can be used subsequently in READ
  1330.          functions.  An example of this statement is
  1331.  
  1332.               infile = open("spiral.dat");
  1333.  
  1334.  
  1335.          Creating an Output File
  1336.  
  1337.          The form of the statement used to create an auxiliary output file
  1338.          is
  1339.  
  1340.              variable = create("file name");
  1341.  
  1342.          When RTAG creates the file it assignes a unique  file  number  to
  1343.          the specified   variable.      This   file  number  can  be  used
  1344.          subsequently in WRITE functions.  An example of this statement is
  1345.  
  1346.              outfile = create("trace.dat");
  1347.  
  1348.  
  1349.          Closing an Auxiliary File
  1350.  
  1351.          The function used to close an auxiliary file is:
  1352.  
  1353.              close(file)
  1354.  
  1355.          where 'file' is a variable that has a file number.  For example:
  1356.  
  1357.              close(outfile);
  1358.  
  1359.          Any  open  files  are  closed  automatically  when  your  program
  1360.          terminates.
  1361.  
  1362.  
  1363.          Reading from an Auxiliary File
  1364.  
  1365.          You  may  read  data  from an open auxiliary file by using a READ
  1366.          function of the following form:
  1367.  
  1368.              read(file,variable1,variable2,...);
  1369.  
  1370.                RTAG -- Ray Tracing Animation Generator      Page 25
  1371.  
  1372.  
  1373.          Where 'file' is a file number assigned by a  previously  executed
  1374.          OPEN function.  Each READ function call reads the  next  line  of
  1375.          data  from  the  file  and  assigns numeric values to the list of
  1376.          variables you specify.  There must  be  at  least  as  many  data
  1377.          values  on the line as the number of variables specified with the
  1378.          READ function (additional values are ignored).  The  data  values
  1379.          may be  separated by spaces, tabs, and/or commas.  Numeric values
  1380.          may be specified in the same  form  as  numbers  within  an  RTAG
  1381.          animation control file (natural, exponential, or dd:dd:dd).
  1382.  
  1383.          The MOREDATA function can be used to control how many records are
  1384.          read from  the  file.  The value of MOREDATA(file) is true (1) if
  1385.          there is another, unread, record available in the file; its value
  1386.          is false (0) if there is no more  data  available  in  the  file.
  1387.          MOREDATA  does  not  consume  any  data,  it  just checks for the
  1388.          availability of data.  The following statements  would  read  all
  1389.          data in a file and generate a frame file for each record:
  1390.  
  1391.              var f,xpos,ypos;
  1392.              f = open("indata.dat");
  1393.              while (moredata(f)) {
  1394.                  nextframe;
  1395.                  read(f,xpos,ypos);
  1396.                  owrite("#declare xpos=`xpos`\n");
  1397.                  owrite("#declare ypos=`ypos`\n");
  1398.              }
  1399.  
  1400.  
  1401.          Writing to an Auxiliary File
  1402.  
  1403.          The form of the function used to write to an auxiliary file is:
  1404.  
  1405.              WRITE(file,"string"[,expression1,expression2,...]);
  1406.  
  1407.          where 'file' is a variable containing a file number assigned by a
  1408.          previously  executed CREATE function. "string" is a quoted string
  1409.          of the same form as described for the PRINT,  OWRITE  and  BWRITE
  1410.          functions.   The  string  may  include  variable  and  expression
  1411.          replacement operators.    Expression1,  expression2,   etc.   are
  1412.          optional  expressions whose values are to be substituted into the
  1413.          string where "%w.dlf" sequences occur.  The following  statements
  1414.          illustrate the use of the WRITE function:
  1415.  
  1416.              var f,x,y;
  1417.              f = create("sine.out");
  1418.              for (x=0; x<360; x+=2) {
  1419.                  y = sin(x);
  1420.                  write(f,"x=`x`, y=`y`\n");
  1421.              }
  1422.              close(f);
  1423.  
  1424.                RTAG -- Ray Tracing Animation Generator      Page 26
  1425.  
  1426.  
  1427.          NOTES ABOUT THE SYSTEM VARIABLES
  1428.  
  1429.          There are four system variables  that  affect  frame  generation:
  1430.          curframe, firstframe,  lastframe,  and stepinc.  Curframe has the
  1431.          current frame number.  Its initial value is 0  before  the  first
  1432.          frame is started.  The NEXTFRAME statement closes the output file
  1433.          (OFILE) if it is open, increments the value of curframe by 1, and
  1434.          opens  a  new  output file (if an OFILE statement was specified).
  1435.          The following loop would be appropriate to generate an  animation
  1436.          with 60 frames:
  1437.  
  1438.              while (curframe < 60) {
  1439.                  nextframe;
  1440.                  << commands to generate frame >>
  1441.              }
  1442.  
  1443.          By default, firstframe has a value of 1, lastframe has a value of
  1444.          999999, and  stepinc  has  a  value  of 1.  There are two ways to
  1445.          assign different values to these variables: the VAR statement  or
  1446.          with command  line options (/F, /L, and /S).  The main reason for
  1447.          setting firstframe and stepinc to something other than  1  is  to
  1448.          make  an abbreviated animation which will give you an idea of how
  1449.          objects will move without spending the time rending  all  of  the
  1450.          images for  a  full  animation.    The  following example shows a
  1451.          command file that will generate images for frames 10 through  60,
  1452.          stepping 5 between the frames:
  1453.  
  1454.              var firstframe = 10;
  1455.              var lastframe = 60;
  1456.              var stepinc = 5;
  1457.              while (curframe < lastframe) {
  1458.                  nextframe;
  1459.                  << commands to generate frame >>
  1460.              }
  1461.  
  1462.          The effect of setting firstframe to something other than 1 may be
  1463.          different than  what  you  expect.    The  current  frame  number
  1464.          (curframe) ALWAYS starts at 0 and increments by 1.  If firstframe
  1465.          is set to something other than 1, the OWRITE and BWRITE functions
  1466.          have no effect until the  frame  number  reaches  the  firstframe
  1467.          value (i.e., when executed they do not write anything to a file).
  1468.          The   reason  that  firstframe  works  like  this  is  that  when
  1469.          performing a simulation the state of the system  usually  depends
  1470.          on  previous  iterations  (e.g.,  the  position of a falling ball
  1471.          depends on how long it has  been  dropping  and  whether  it  has
  1472.          already hit the floor).  Because of this it is necessary to start
  1473.          at the  beginning  each time.  However, by cancelling the actions
  1474.          of the OWRITE and BWRITE functions prior to firstframe,  you  can
  1475.          save the expense of rendering frames before the one of interest.
  1476.  
  1477.          There are  two  exceptions to this rule.  BWRITE functions always
  1478.          generate output before  the  first  execution  of  the  NEXTFRAME
  1479.          statement  regardless  of the value of firstframe, lastframe, and
  1480.  
  1481.                RTAG -- Ray Tracing Animation Generator      Page 27
  1482.  
  1483.  
  1484.          stepinc.  This is done so that initialization statements  can  be
  1485.          generated before the frame generation iteration begins.    BWRITE
  1486.          functions  also  always generate output after the execution of an
  1487.          EPILOG statement.  This is done so that you can write cleanup and
  1488.          termination commands to the batch and auxiliary  files.    PRINTF
  1489.          and  WRITE  functions  generate output regardless of the value of
  1490.          firstframe.
  1491.  
  1492.          The effect of stepinc is similar to firstframe.    The  NEXTFRAME
  1493.          statement ALWAYS increments the frame number by 1.  If stepinc is
  1494.          not  1,  OWRITE  and  BWRITE  functions  are disabled between the
  1495.          steps.  BWRITE always generates output before  the  execution  of
  1496.          the  first  NEXTFRAME  statement and after execution of an EPILOG
  1497.          statement.
  1498.  
  1499.  
  1500.          ANIMATION AND TIME CONTROL
  1501.  
  1502.          Time is an essential component of  any  animation.    Except  for
  1503.          special  effects,  time  advances  by  a  constant amount between
  1504.          frames.  Most RTAG animation control files  will  have  an  outer
  1505.          loop advancing  through  either  frames  or  time.    For  simple
  1506.          animations  it  is  usually  easier  to  loop   through   frames,
  1507.          calculating the simulated time as a function of the frame number.
  1508.          For  example, the following statements would move an object along
  1509.          a sinusoidal (wavey) path using the frame number as  an  argument
  1510.          to the SIN function:
  1511.  
  1512.              while (curframe < 60) {
  1513.                  nextframe;
  1514.                  x = -6 + (curframe / 5);
  1515.                  y = 3 * sin(curframe * 12);
  1516.                  << other statements to generate output >>
  1517.              }
  1518.  
  1519.          This approach works well for simple animations where the position
  1520.          of  the  objects  can  be  calculated as a direct function of the
  1521.          frame number.  However, for more complex  animations,  especially
  1522.          those involving acceleration and interactions between objects, it
  1523.          may  be  necessary  to  perform  the simulation with smaller time
  1524.          steps than the time between frames.  In other  words,  the  outer
  1525.          loop  should  advance  the  simulation  time and frames should be
  1526.          generated at  periodic  intervals  to  take  "snapshots"  of  the
  1527.          objects.  The following statements illustrate this approach:
  1528.  
  1529.                RTAG -- Ray Tracing Animation Generator      Page 28
  1530.  
  1531.  
  1532.              for (time=0; time<endtime; time+=timestep) {
  1533.                  //  Calculate updated positions of objects
  1534.                  x = x + xspeed * timestep;
  1535.                  y = y + yspeed * timestep;
  1536.                  << other statements to compute object positions >>
  1537.                  //  See if it is time to generate a frame
  1538.                  if (time >= frametime) {
  1539.                      //  Generate a frame
  1540.                      nextframe;
  1541.                      << statements to write to files >>
  1542.                      //  Calculate when next frame should be generated
  1543.                      frametime = frametime + sampletime;
  1544.                  }
  1545.              }
  1546.  
  1547.  
  1548.          EXAMPLE ANIMATIONS
  1549.  
  1550.          The RTAG distribution comes with several example files which  are
  1551.          explained below.    For each example there is an ".RTA" animation
  1552.          command file and a ".POV" POV-Ray scene description file.
  1553.  
  1554.          TOUR -- There is a simulated "city" (would you believe a  village
  1555.               with high  rise  buildings?).    The  camera begins from the
  1556.               distance, sweeps down and along  "Main  Street",  circles  a
  1557.               dome  structure  at  the  end,  and  then climbs while still
  1558.               keeping the buildings in view as it moves away.  The  SPLINE
  1559.               function  is used both to control the position of the camera
  1560.               and also the location that the camera is looking at.    This
  1561.               120-frame animation takes about 6 hours to render in 320x200
  1562.               size  with anti-aliasing turned on running on a 486/33 using
  1563.               POV-Ray.
  1564.  
  1565.          BOUNC -- Bouncing ball simulation.  A ball  rolls  down  a  ramp,
  1566.               falls, bounces twice, and ends up in landing in a can.  This
  1567.               is  a good example of a simulation where time is advanced in
  1568.               small  steps  and  frames  are  generated  periodically   as
  1569.               "snapshots" of  the  scene.    The  position  of the ball is
  1570.               calculated  using  elementary  physics:  The  speed  of   an
  1571.               accelerating  object  at the end of a time interval is equal
  1572.               to  its  speed  at  the  beginning  plus  the   acceleration
  1573.               multiplied by the time interval.  The position at the end of
  1574.               an  interval  is  equal  to the position at the start of the
  1575.               interval plus the speed multiplied by the time interval.  An
  1576.               animation with 60 to 70 frames seems to work best with  this
  1577.               example.
  1578.  
  1579.          ORBIT --  Orbital  simulation.   Three planets move in elliptical
  1580.               orbits around a sun.  One of the planets has  a  moon  in  a
  1581.               circular orbit.    The  orbital speeds of the planets follow
  1582.               Kepler's laws.  If you look closely you can see  the  shadow
  1583.               as one planet eclipes another.  The 200 frame sequence takes
  1584.               about 4 hours to render on a 386/25 with coprocessor.
  1585.  
  1586.                RTAG -- Ray Tracing Animation Generator      Page 29
  1587.  
  1588.  
  1589.  
  1590.  
  1591.          USE AND DISTRIBUTION OF RTAG
  1592.  
  1593.          You are welcome to make copies of this program and pass  them  on
  1594.          to  friends or post this program on bulletin boards or distribute
  1595.          it  via  disk  catalog  services   provided   the   entire   RTAG
  1596.          distribution is  included  in  its  original, unmodified form.  A
  1597.          distribution fee may be charged for the  cost  of  the  diskette,
  1598.          shipping and  handling.    However,  RTAG  may  not  be  sold, or
  1599.          incorporated  in  another  product  that  is  sold,  without  the
  1600.          permission of  Phillip  H.  Sherrod.    Vendors are encouraged to
  1601.          contact the author to get the most recent version of RTAG.
  1602.  
  1603.          As a shareware product, you are granted a no-cost,  trial  period
  1604.          of  30  days during which you may evaluate RTAG. If you find RTAG
  1605.          to be useful, educational, and/or entertaining, and  continue  to
  1606.          use  it  beyond  the  30  day  trial  period, you are required to
  1607.          compensate the author by sending the registration form printed at
  1608.          the  end  of  this  document  (and  in  REGISTER.DOC)  with   the
  1609.          appropriate  registration  fee  to help cover the development and
  1610.          support of RTAG.
  1611.  
  1612.          In return for registering, you will  be  authorized  to  continue
  1613.          using  RTAG beyond the trial period and you will receive the most
  1614.          recent version of the program, a laser-printed, bound manual, and
  1615.          three months of support via telephone, mail, or CompuServe.  Your
  1616.          registration fee will be refunded if you encounter a serious  bug
  1617.          that cannot be corrected.
  1618.  
  1619.          You are welcome to contact the author:
  1620.  
  1621.                                 Phillip H. Sherrod
  1622.                                  4410 Gerald Place
  1623.                           Nashville, TN  37205-3806  USA
  1624.                               615-292-2881 (evenings)
  1625.                               CompuServe: 76166,2640
  1626.                         Internet: 76166.2640@compuserve.com
  1627.  
  1628.          Both the RTAG program and documentation are copyright (c) 1993 by
  1629.          Phillip H.  Sherrod.    You  are  not  authorized  to  modify the
  1630.          program. "RTAG" is a trademark.
  1631.  
  1632.          This program is produced  by  a  member  of  the  Association  of
  1633.          Shareware Professionals  (ASP).   ASP wants to make sure that the
  1634.          shareware principle works for you.  If you are unable to  resolve
  1635.          a  shareware-related problem with an ASP member by contacting the
  1636.          member directly, ASP may be able to help.  The ASP Ombudsman  can
  1637.          help  you  resolve  a  dispute or problem with an ASP member, but
  1638.          does not provide technical support for members' products.  Please
  1639.          write to the ASP Ombudsman at 545 Grover Road, Muskegon, MI 49442
  1640.          or send a CompuServe message via CompuServe Mail to ASP Ombudsman
  1641.          7007,3536.
  1642.  
  1643.                RTAG -- Ray Tracing Animation Generator      Page 30
  1644.  
  1645.  
  1646.  
  1647.  
  1648.          DISCLAIMER
  1649.  
  1650.          RTAG  is  provided  "as is"  without warranty of any kind, either
  1651.          expressed or implied.    This  program  may  contain  "bugs"  and
  1652.          inaccuracies, and its results should not be assumed to be correct
  1653.          unless they  are  verified  by  independent  means.    The author
  1654.          assumes no responsibility for the use of RTAG  and  will  not  be
  1655.          responsible for any damage resulting from its use.
  1656.  
  1657.                RTAG -- Ray Tracing Animation Generator      Page 31
  1658.  
  1659.  
  1660.  
  1661.  
  1662.                                 MATHPLOT and NONLIN
  1663.  
  1664.  
  1665.  
  1666.          If you like RTAG, you should check out the  Mathplot  and  Nonlin
  1667.          programs by the same author.
  1668.  
  1669.  
  1670.          Mathplot allows you to specify complicated mathematical functions
  1671.          using  ordinary  algebraic expressions and immediately plot them.
  1672.          Four types of functions may  be  specified:  cartesian  (Y=f(X));
  1673.          parametric     cartesian     (Y=f(T)     and    X=f(T));    polar
  1674.          (Radius=f(Angle));  and   parametric   polar   (Radius=f(T)   and
  1675.          Angle=f(T)).  Up to four functions may be plotted simultaneously.
  1676.          Scaling is  automatic.    Options  are  available to control axis
  1677.          display and labeling as well as grid lines.  Hard copy output may
  1678.          be generated as well as screen display.   Mathplot  is  an  ideal
  1679.          tool  for  engineers,  scientists, math and science teachers, and
  1680.          anyone  else  who  needs  to   quickly   visualize   mathematical
  1681.          functions.   Mathplot  requires  a  CGA,  EGA,  or  VGA  monitor.
  1682.          Hardcopy plots can be displayed on HP LaserJet printers.
  1683.  
  1684.  
  1685.          Nonlin  performs  linear  and  nonlinear  statistical  regression
  1686.          analysis.   Nonlin  determines  the  values  of parameters for an
  1687.          equation, whose form you specify, that cause the equation to best
  1688.          fit a  set  of  data  values.     Nonlin   can   handle   linear,
  1689.          multivariate, polynomial,  and  general nonlinear equations.  You
  1690.          specify the form of the equation using normal algebraic notation.
  1691.          The data values and fitted  equation  can  be  displayed  on  the
  1692.          screen or  an  HP  LaserJet printer.  Nonlin is the best and most
  1693.          powerful shareware regression program available.
  1694.  
  1695.                RTAG -- Ray Tracing Animation Generator      Page 32
  1696.  
  1697.  
  1698.                         TSX-32 Multi-User Operating System
  1699.  
  1700.          If  you  have  a  need  for a multi-user, multi-tasking operating
  1701.          system, you should look into TSX-32.  TSX-32 is a  full-featured,
  1702.          high performance, multi-user operating system for the 386 and 486
  1703.          that provides  both  32-bit  and  16-bit  program  support.  With
  1704.          facilities such as multitasking  and  multisessions,  networking,
  1705.          virtual memory, X-Windows, background batch queues, data caching,
  1706.          file  access  control,  real-time,  and  dial-in  support, TSX-32
  1707.          provides a solid environment for a wide range of applications.
  1708.  
  1709.          TSX-32 is not a limited, 16-bit, multi-DOS add-on.  Rather, it is
  1710.          a complete 32-bit operating system which makes full  use  of  the
  1711.          hardware's potential, including protected mode execution, virtual
  1712.          memory, and demand paging.  TSX-32 sites range from small systems
  1713.          with  2-3  terminals  to  large  installations  with more than 64
  1714.          terminals on a single 386.
  1715.  
  1716.          In addition to  supporting  most  popular  16-bit  DOS  programs,
  1717.          TSX-32 also provides a 32-bit "flat" address space with both Phar
  1718.          Lap and DPMI compatible modes of execution.
  1719.  
  1720.          Since  the  DOS  file  structure  is standard for TSX-32, you can
  1721.          directly read and write DOS disks.  And, you can run DOS part  of
  1722.          the time and TSX-32 the rest of the time on the same computer.
  1723.  
  1724.          TSX-32 allows  each  user to control up to 10 sessions.  Programs
  1725.          can also "fork" subtasks for multi-threaded  applications.    The
  1726.          patented Adaptive Scheduling Algorithm provides consistently good
  1727.          response time under varying conditions.
  1728.  
  1729.          The  TSX-32  network  option  provides  industry  standard TCP/IP
  1730.          networking through Ethernet  and  serial  lines.    Programs  can
  1731.          access  files  on  remote  machines  as  easily  as  on their own
  1732.          machine.  The SET HOST command allows a user on  one  machine  to
  1733.          log onto  another  computer in the network.  FTP, Telnet, and NFS
  1734.          are available for interoperability with other systems.
  1735.  
  1736.          TSX-32  allows  simultaneous  real-time  program  execution  with
  1737.          normal time-sharing  operations.   Real-time programs can connect
  1738.          to interrupts, access device control  ports,  and  preempt  other
  1739.          operations when necessary.  TSX-32 is an ideal process control or
  1740.          data collection system.
  1741.  
  1742.          TSX-32  is,  quite  simply,  the best and most powerful operating
  1743.          system available for the 386 and 486.  For additional information
  1744.          contact:
  1745.                             S&H Computer Systems, Inc.
  1746.                               1027 17th Avenue South
  1747.                               Nashville, TN 37212 USA
  1748.                                615-327-3670 (voice)
  1749.                                 615-321-5929 (fax)
  1750.                                CompuServe: 71333,27
  1751.  
  1752.                RTAG -- Ray Tracing Animation Generator      Page 33
  1753.  
  1754.  
  1755.        =====================================================================
  1756.                                 Software Order Form
  1757.        =====================================================================
  1758.  
  1759.          Name ______________________________________________________
  1760.  
  1761.          Address ___________________________________________________
  1762.  
  1763.          City _______________________  State _______ Zip ___________
  1764.  
  1765.          Telephone _________________________________________________
  1766.  
  1767.          CompuServe account (optional) _____________________________
  1768.  
  1769.          RTAG version ______________________________________________
  1770.  
  1771.          Bulletin board where you found RTAG _______________________
  1772.  
  1773.          Comments __________________________________________________
  1774.  
  1775.          Check the boxes which indicate your order type:
  1776.  
  1777.          ___ I wish to register RTAG ($20).
  1778.  
  1779.          ___ I wish to order Mathplot ($20).
  1780.  
  1781.          ___ I wish to order Nonlin ($25)
  1782.  
  1783.          Add  $5 to the total amount of the order if the software is being
  1784.          shipped out of the United States.
  1785.  
  1786.          In return for registering,  you  will  receive  the  most  recent
  1787.          version  of  the  program,  a  laser-printed,  bound  copy of the
  1788.          manual, and three months  of  telephone  or  CompuServe  support.
  1789.          Your  registration fee will be refunded if you find a serious bug
  1790.          that cannot be corrected.
  1791.  
  1792.          Distribution disk choice (check one):
  1793.  
  1794.                3.50" HD (1.4 MB)  ______
  1795.                5.25" HD (1.2 MB)  ______
  1796.                5.25" DD (360 KB)  ______
  1797.  
  1798.          Send this form with the amount indicated to the author:
  1799.  
  1800.                                 Phillip H. Sherrod
  1801.                                  4410 Gerald Place
  1802.                            Nashville, TN  37205-3806 USA
  1803.  
  1804.                               615-292-2881 (evenings)
  1805.                               CompuServe: 76166,2640
  1806.                         Internet: 76166.2640@compuserve.com
  1807.