home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / pvrayfiles / EquPath / !EquPath / !Help next >
Text File  |  1988-06-16  |  9KB  |  239 lines

  1.      Persistence of Vision Raytracer (PV-Ray)
  2.           Twister - Extension utility
  3.      ------------------------------------------------
  4.      Twister is © Scintillating Graphics Company
  5.  
  6. 22/10/93
  7.  
  8.  
  9.  
  10. This program is freely distributable. The author retains the copyright to
  11. the program but authorizes free distribution by BBS'es, networks, magnetic
  12. media, etc. The distributor may charge no more than the two pounds (£2) U.K
  13. for this software.
  14.  
  15. The data files generated by this utility are the property of the user of the
  16. software and may be used for any purpose without restriction.
  17.  
  18. The author makes no quarantees or warranties with this program and claims no
  19. responsibility for any damage or loss of time caused by this program. Bug
  20. reports may be sent the the author but the author is under no obligation to
  21. provide bug fixes, features, or any support for this software.
  22.  
  23. The following conditions are also placed on the use of this program.
  24.  
  25.  1) That is should not be used as part of any commercial package without the 
  26.     explicit written consent of the Author
  27.  2) If you create any interesting pictures, please send them to me.
  28.  3) If you make any changes to the source code, please let me know.
  29.  4) This text file must accompany the program.
  30.  
  31.  
  32.  
  33. This manual is divided into the following sections:
  34.  
  35.    1) Application Description
  36.    2) A Tutorial Walkthrough
  37.    3) The Creation Parameters
  38.    4) Concluding Remarks
  39.  
  40.  
  41. 1)  Application Description
  42.  
  43.  
  44.  
  45. This application is an additional utility which provides support for
  46. creating more complex data files for the Persistence of Vision Raytracer,
  47. which would otherwise be time consuming to write by hand. The program
  48. provides creates a data file of a shape following a user defined equation
  49. for each of the three axis that can be included in your scene script. This
  50. can produce some interesting spirals and wave paths.
  51.  
  52.  
  53.  
  54.  
  55. 2)  A Tutorial Walkthrough
  56.  
  57. This section is designed to get you up and running creating your own path
  58. data files without all the nit-picky details. Once you've gone through this,
  59. you'll probably ignore the rest of the manual because it's so simple.
  60.  
  61.  
  62. 2.1)     Begining To Create A File
  63.  
  64. Double click on the appliaction icon in the filer window, The application
  65. will the install itself on the iconbar. Click on the icon to bring up the
  66. parameters window.
  67.  
  68.  
  69. 2.2)     Altering the parameters
  70.  
  71. The parameters control how the object is moved through space, the object to
  72. move, and what the complete path will be declared as. You can move the caret
  73. through the options using the arrow keys, or click in a box with the mouse
  74. to enter that parameter. For the moment, enter the following values,
  75. TraceMe, Path, 10, 100, 0, SIN(RAD(t))*10, 0, t. Note that the case of
  76. characters in the first two inputs and the last the last three are
  77. important. The first two must correspond exactly to the names you use when
  78. you #include the file in your PVRay script file, the last three are basic
  79. expressions which are evaluated by the program to create the path.
  80.  
  81.  
  82. 2.3)     Creating the Path data file
  83.  
  84. Now that we have set up the parameters, we can create the twister data file
  85. by clicking on the "Create" icon at the bottom of the window. A standard
  86. save dialogue box will appear, either drag the icon to a filer or enter the
  87. pathname. The hourglass will appear along with a percentage indication of
  88. how much of the data file has benn created.
  89.                                                                          
  90.  
  91. 2.4)     Implementing the data file
  92.  
  93. Now we have created the data file, we need to display it. You could always
  94. drag it onto your editor window, and paste it straight into your main data
  95. file, or you could always #include it. Either way, there are a couple of
  96. things you need to do first.
  97.  
  98.  
  99. 2.4.1)   Declaring the object to twist.
  100.  
  101. First we must declare the object that we want to follow the path. You will
  102. remember (At least I hope you will!), that we told the application that we
  103. wanted it to twist a shape named TraceMe, or whatever you instructed it. We
  104. must therefore declare the shape TraceMe.
  105.  
  106.    #declare TraceMe = quadric
  107.       QSphere
  108.    end_quadric
  109.  
  110. The shape that follows the path must be a quadric, in our case we are using
  111. a sphere, this will produce a line of dots following the curved path of a
  112. sin wave.
  113.  
  114.  
  115. 2.4.2)   Including the path datafile
  116.  
  117. Now that we have declared the object that follows the path, we can now #include our path file, you will obviously need to change the pathname to suit your own system.
  118.  
  119.    #include "IDEFS::HardDisc4.$.Apps.PV.PVWidgets.Twisted"
  120.                           
  121.  
  122. 2.4.3)   Creating the twisted object
  123.  
  124. We can now create the path by placing the name that we declared our twister
  125. under, "Path" inside an OBJECT ... END_OBJECT block, and assigning any
  126. relevant texture details.
  127.  
  128.    OBJECT
  129.       Path
  130.       TEXTURE
  131.          COLOUR Red 1.0
  132.          PHONG 0.4
  133.          PHONGSIZE 60
  134.       END_TEXTURE
  135.    END_OBJECT
  136.  
  137. We have now created our Path at <0 0 0>, and stretching towards <0 0 100>
  138. before you render the scene you will need to put in a light source, and a
  139. view point, but I'll leave that up to you. If you are stuck, look at the
  140. TwistTest file to see how it has been done, the file also includes a
  141. lightsource and the viewpoint if you are unsure where to place them.
  142.  
  143.  
  144. 3) The Creation Parameters
  145.  
  146. This section looks in more depth at the parameters that can be altered
  147. within the program to alter the shape of the twist.
  148.  
  149.  
  150. 3.1) The object to trace
  151.  
  152. Changing this changes the name of the object to trace. The object to trace
  153. must be a quadric. Best effects are achieved with a sphere, although any quadric, with any scaling or translation could be used.To avoids gaps appearing in the path you can either increase the number of steps, or the size of the quadric.
  154.             
  155.  
  156. 3.2) Declare as.
  157.  
  158. This is the name that the path will be declared under, it is the name you
  159. specify in the OBJECT ... END_OBJECT construct of your scene script. The
  160. paths start and end points all depend on the equations you use to give the
  161. position, and the range of values you tell it to calculate.
  162.  
  163.  
  164. 3.3) The number of steps.
  165.  
  166. This is the number of times the program will calculate the position and
  167. place an object at that point. If you want fifty spheres following a sin
  168. wave you would need to enter 50 in this parameter.
  169.  
  170.  
  171. 3.4) Maximum and Minimum ranges.
  172.  
  173. These are the upper and lower limits for the variable "t" which is
  174. incrememnted by an amount each time an object needs to be plotted. "t" is
  175. incremented by the exact amount required to give the number of steps between
  176. the minimum value and the maximum value.
  177. If your equations are based on degrees, set the maximum value to 360, the
  178. minimum value to 0 and the number of steps to 360, the program will now plot
  179. an object for every degree in the circle.
  180.  
  181.  
  182. 3.5) The Equations
  183.  
  184. The equations give the values of X,Y and Z at which the object should be plotted. The equation can be any function which can be evaluated by BASIC's EVAL function. The variable which is increase between plots is "t", "t" will always be between the minimum and maximum ranges.
  185.  
  186. Legitimate commands are :
  187.  
  188. +         -         *         /         ^
  189. ABS       ACS       ASN       ATN       COS
  190. DEG       DIV       EXP       INT       LOG
  191. LN        PI        RAD       RND       SGN
  192. SQR       TAN       (         )         t
  193.    
  194.  
  195. Example - The quadratic equation y=x²+2x-8
  196.  
  197.    X - needs to increased at a uniform rate, the only value which changes is
  198.        "t", therefore need to place "t" in the X equation, ie. X=t.
  199.  
  200.    Y - is function of X, unfortunately we can't use X directly so we need to
  201.        substitute the euqation that equals X for all the X's in the Y=f(X)
  202.        equation. Luckily X=t, so it is simply a matter of replacing the X's
  203.        with t's. The only other things we need to remember is that the ²
  204.        symbol will cause a crash, we need to use ^2 instead and that 2x
  205.         needs to be expanded to 2*x. The Y equation should look like this,
  206.         Y=t^2+2*t-8 .
  207.  
  208.        Set ranges of -20 to 20 and the number of steps to 40, and you will
  209. create a parabola.
  210.  
  211.  
  212. 4) Concluding Remarks
  213.  
  214. This is version 1.0 of EquPath. Additional features s