home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / p / povcad10.zip / POVCAD.DOC next >
Text File  |  1993-02-27  |  20KB  |  525 lines

  1.                              POVCAD 1.0 by 
  2.                             Alfonso Hermida 
  3.                      Pi Square BBS (301)725-9080
  4.                                 2/26/93
  5.  
  6. NOTE: POVCAD is written in Visual Basic 2.0 for Windows (Microsoft Corp).
  7.       To run it you'll need the runtime module VBRUN200.DLL.        
  8.                         
  9. -------------------------------------------------------------------------
  10. Copyright (c) 1993 by Alfonso Hermida.
  11. All rights reserved.  The program POVCAD.EXE is distributed "As is". 
  12. The author assumes no reponsibility for damages resulting from the use of
  13. this program.  The program has been tested but no software is "bug-free" 
  14. so...use at your own risk!
  15. -------------------------------------------------------------------------
  16.  
  17. Distribution:
  18. Feel free to distribute POVCAD.EXE and it's companion file POVCAD.DOC for
  19. non comercial purposes.  Distributors may charge up to $5 for this program.
  20. If you wish to distribute this program with a comercial software please 
  21. contact the author at the BBS number given above or by mail:
  22.        Alfonso Hermida, 9346 Kings Grant Rd, Laurel, MD 20723.
  23.  
  24. This program is distibuted as Shareware.  You may use this program for
  25. a period of 30 days at which you must either register this software or
  26. stop using it.  Registration entitles you to support thru the BBS.  
  27.  
  28. Registration cost is only $15 and helps continuing work to improve this
  29. software.  To register send your check or money order to the above address
  30. with your name, address, phone number and a password(for BBS access).  Check
  31. at the end of this document for registration form.
  32.  
  33. --------------------------------------------------------------------------
  34.  
  35. What's POVCAD?
  36.  
  37. POVCAD is a small solid object modeling tool to create scene files for
  38. raytracers.  It's based primarily on the POV(Persistence of Vision)
  39. raytracer written by the Persistence of Vision Group.  POV is a copyrighted
  40. freeware raytracer.  If you would like to get in contact with them, 
  41. contact Compuserve (800)848-8990, Comart forum Raytracing section 16, or
  42. call YCCMR BBS (708)358-5611, which is a raytracer specific BBS.
  43.  
  44. With POVCAD you're able to create visually the scene file and have a
  45. pretty good idea (geometry-wise) of how the objects are positioned in 
  46. 3D space.  There is no support for textures and color visualization since
  47. POVCAD is a wire frame-based program.  Nor, you'll see the results of
  48. any constructive solid geometry operation (boolean operation..for short).
  49.  
  50.  
  51. POVCAD supports the following objects:
  52. * planes
  53. * cylinder
  54. * cone
  55. * sphere
  56. * ellipsoid
  57. * torus 
  58. * box
  59. * height_field
  60. * Raw data files (loading)
  61. * Sweep (solid of revolution)
  62. * light_source 
  63.  
  64. and operations such as union, difference,intersection and composite 
  65. objects.  Textures can be selected from a list without need of typing.
  66. The scene view can be changed between isometric,YX,YZ and ZX.
  67. A session list shows the steps you took to create any image and you may
  68. select any of the objects from the list by clicking on it.
  69.  
  70. An interesting feature is the ability to create or read data files
  71. with path information for animation software.  You can create linear
  72. interpolated data, circular motion, parabolic, helix or just freehand
  73. mode, where you sketch the path with the mouse.  POVCAD does not do
  74. animation but it plots the path files so you can see how things look
  75. on the screen.  The data can be transformed like any object in POVCAD.
  76.  
  77. In the File menu, there is an option to save the session file and to 
  78. Export to POV (that is to create the POV session file).
  79.  
  80.  
  81. AN IMPORTANT NOTE:  All rotations and translations are absolute(measured
  82. from the origin).  Therefore, if an object has been translated to (1,1,1)
  83. and you change the x to 1.5, it will be (1.5,1,1) and not (2.5,1,1).
  84.  
  85. My best suggestion is that you play with it for a while to get a better
  86. understanding of the program.  
  87.  
  88.  
  89. Creating an Object
  90.  
  91. To create an object is easy.  Here are the steps:
  92.  
  93. 1) Click on the Object menu and click again on the object you would
  94.    like to create.  All objects start at the origin, except the sphere
  95.    which asks for the center coordinates. 
  96.  
  97. 2) To rotate/translate or scale the object, click on Xform and select
  98.    the appropiate transformations.  The way this program was developed,
  99.    rotations are ALWAYS applied first THEN the translations.   Keep that
  100.    in mind.
  101.  
  102. 3) If you need to edit/delete an object, click on Session and click on the
  103.    object to be modified.  On the bottom right part, the current object
  104.    is shown, with it's texture.  If the object is already there,  you can
  105.    operate on it without having to click on Session.
  106.  
  107. NOTE:The LAST object created is ALWAYS the current object.  If you wish
  108.      to tranform it, just go directly to Xform or Texture (if you want
  109.      to put a texture to it).  
  110.  
  111.    To delete an object, either select it (thru the Session menu) or just
  112.    go to Edit if it's the last object drawn and click on Del.
  113.  
  114.  
  115. NOTE: The format of RAW data files is:
  116.   x1 y1 z1 x2 y2 z2 x3 y3 z3
  117.   x4 y4 z4 x5 y5 z5 .......
  118.   ...... ect ..............
  119.  
  120. where each line represents a triangle.  Usually I use Steve Anger's
  121. RAW2POV program to create objects with RAW data files.  RAW2POV will
  122. optimize A LOT the image, while POVCAD will just convert the data to
  123. triangles and that's it!  
  124.  
  125. Creating Solids of Revolution (Sweep command)
  126.  
  127. 1) Click on the PointOff button (to enable point creation)
  128. 2) Select a View different than Iso (i.e. YX,ZX or YZ)
  129. 3) Click on the window and draw a contour (up to 25 points)
  130. 4) Select the Sweep command from the Objects menu
  131. 5) give a filename.ext (the data will be saved in RAW format)
  132. 6) indicate sweep angle and number of segments
  133.  
  134. * If you wish to erase the points and start all over use the Del Points
  135.   command in the Edit menu.
  136. * SnapOn forces the points to fall in the intersections of the grid
  137.   lines, while GridOff let's you select any place on the screen.
  138.  
  139.  
  140.  
  141. Creating Constructive Solid Geometry 
  142.  
  143. Let's use an example to explain this topic:
  144. We'll assume we want to create a cylinder with a hole in the middle.
  145. Since the operation is a difference:
  146.  
  147. 1) click on CSG and then select "difference".
  148. 2) create the cylinder and position it.
  149. 3) create a sphere (the hole) and position it.
  150. 4) Click on CSG and then "Close".
  151.  
  152. Close is the command to tell the program that the current CSG operation
  153. has ended.  The Session list would look like this:
  154.  
  155. DIFFR
  156. CYL ........
  157. SPH ........
  158. ENDF
  159.  
  160. Where:
  161. DIFFR   = difference operation
  162. CYL ... = cylinder definition and transformations
  163. SPH ... = sphere definition and transformations
  164. ENDF    = tells the program that this is where the difference operation
  165.           ends
  166.  
  167. Now let's assume that you want to create a union of 2 cylinders each
  168. one with a hole in it:  This is how the Session list would look like:
  169.  
  170.                       comments:
  171. UNION                  1) union operation starts here
  172. DIFFR                  2) difference operation starts here
  173. CYL ....               3) cylinder #1
  174. SPH ....               4) sphere #1
  175. END                    5) clicked on CSG then on Close
  176. DIFFR                  6) Start another difference
  177. CYL ....               7) cylinder #2
  178. SPH ....               8) sphere #2
  179. END                    9) clicked on CSG then Close
  180. ENDF                   10)clicked on CSG then Close 
  181.                          (click on TEXTURE to add one to the object)
  182.  
  183. As you can see, the software uses END and ENDF to distinguish between
  184. intermediate CSG operations and the final CSG operation...in this case
  185. the UNION was the final and the DIFFR were the intermediate.
  186.  
  187. The same idea applies to all CSG operations.  Composite is not a CSG but
  188. it was the best place to put it. <grin>
  189.  
  190.  
  191. * TEXTURES ON CSG OBJECTS *
  192.  
  193. To put a texture on a CSG object click on ENDF(using the Session command)
  194. to make it the current object (you'll see ENDF at the bottom right part
  195. of the screen) then click on TEXTURE to add the one that you want.
  196.  
  197.  
  198. Transforming CSG /Composite objects
  199.  
  200. At this point it is NOT possible to transform (XFORM) the whole set of
  201. objects.  You may XFORM any of the individual objects that compose a CSG
  202. object.
  203.  
  204.  
  205.  
  206. Quick Comment
  207.  
  208. If you want to clip an object with 2 planes do the following:
  209. 1) Click on "intersection"
  210. 2) create the object to be clipped
  211. 3) create plane #1
  212. 4) create plane #2
  213. 5) rotate plane #2 so that the normal is facing oposite
  214.    to plane #1's normal.  (When a plane is created, the normal
  215.    is ALWAYS in the + direction of the axis.) Also you must translate
  216.    plane #2 so they're not in the same place. 
  217.  
  218.    Example:
  219.    plane#1: PLANE_Y,Translate_Y = .5 
  220.    plane#2: PLANE_Y,Translate_Y = -.5,Rotate_Z = 180
  221.    
  222.    Plane #1's normal is pointing in the +Y direction, while
  223.    plane #2's normal is in the -Y direction (due to rotation
  224.               about Z of 180 degrees)
  225.  
  226.    Any object placed in the origin will be clipped at Y=0.5 and
  227.    Y=-0.5 . Try it and see!
  228.  
  229.  
  230. Creating PATH data files for your animations
  231.  
  232. This feature allows you to create data files of paths that may be
  233. used in animations programs.  Simply select the Path menu and select
  234. which curve to create.  These data files can be XFORMed in the same
  235. fashion as any of the objects supported by POVCAD.
  236.  
  237. To create a curve, select the corresponding curve and you'll be asked
  238. for a filename to save the data. This is done to reduce memory
  239. requirements on your system.  The following is a brief description:
  240.  
  241. 0) Load and SAVE
  242.    Load read any 3D point ASCII file and converts it into a path,
  243.    i.e. lines will be drawn to connect the points sequentially.  Your
  244.    data file SHOULD NOT have an extension *.PTH since this is used by
  245.    POVCAD to save the final path files.
  246.  
  247.    SAVE converts your data file, i.e. filename.ext into filename.PTH.
  248.    Initially, filename.ext was a set of 3D points that you created
  249.    yourself or thru POVCAD.  Since you may want to rotate, scale or
  250.    translate the data, POVCAD takes those operations and changes your
  251.    data.  In order to keep the original data intact, POVCAD saves the
  252.    new data with the PTH extension.
  253.  
  254.    The EXPORT to POV function in the FILE menu also creates the *.PTH
  255.    files.  If you haven't created any 3D objects and you don't need to
  256.    create a POV file, simply use the SAVE function in the PATH menu, to
  257.    save your animation files.
  258.  
  259.    To merge 2 or more data files, drop to DOS or load a texteditor
  260.    and simply append one file to the other to create more complicated
  261.    path data files.  It's that simple! (gasp!...I hope it works)
  262.  
  263.  
  264. 1) Freehand
  265.    Converts a set of points created on the screen to a path.  Maximum
  266.    number of points is 25 (at this point at least)
  267.  
  268. 2) Linear
  269.    Click 2 points (more than that will be discarded) on the screen.
  270.    The routine will subdivide the line segment into a set of points.
  271.  
  272. 3) Circular
  273.    Creates a circular path.  No points have to be created with the
  274.    mouse.
  275.  
  276. 4) Parabolic
  277.    Follows the curve Y = aX^2 where a is the parabola coefficient
  278.    and the value of Y is the height.  The value of Z is zero but
  279.    you may create this curve from any view.  The routines will swap
  280.    the axis to reflect the view you're in.
  281.  
  282. 5) Helix
  283.    Creates a "spring".  The curve follows :
  284.     x = a cos(2*pi*t)
  285.     y = a sin(2*pi*t)
  286.     z = t
  287.     
  288.     Therefore Z is the "height" of the function.  This depends on the
  289.     current view setting.
  290.  
  291. After creating the curves you may use them to animate your raytraced
  292. images.  POVCAD simply creates the curves and shows them with the
  293. geometry so you have a better understanding of how things might look.
  294. Remember, you can scale, rotate and translate the data like any other
  295. object!  have fun!
  296.  
  297. Creating LightSources
  298.  
  299. To create a light_source object, click on the Light command in the main
  300. menu.  Enter the origin coordinates of the light_source (x,y,z).  To
  301. add a color to the light_source, select it (Session) then click on the
  302. Color command in the main menu.  You may select any color or edit the
  303. string "red # green # blue #" by replacing the "#" with appropiate numbers.
  304. If you wish to move the light_source, click on XFORM and modify the
  305. translate parameters.
  306.  
  307. The rotation angles do not apply to light_sources.  The scale factors will
  308. only affect the size of the light_source symbol (resembles a 3D axis) in
  309. POVCAD, POV does not require a scaling factor.
  310.  
  311.  
  312. How does POVCAD save the objects?
  313.  
  314. POVCAD saves 3 files for every session: {(4) is optional }
  315. 1) *.CAD   This is the object definitions file
  316. 2) *.TEX   file with the textures of each object
  317. 3) *.WRL   world definition of the session
  318. 4) *.PTH   data files to be used in your animation programs
  319.  
  320. *.CAD file structure:
  321. This is the format that POVCAD uses for those of you that want to create
  322. external programs to deal with them.  The file is an ASCII file with 
  323. double quotes at the begining and end of each statement:
  324.  
  325. rx,ry,rz = rotations about each axis (absolute)
  326. tx,ty,tz = translations on each axis
  327. sx,sy,sz = scale factors for x,y and z
  328.  
  329. 1) Plane:    "PLN axis rx ry rz tx ty tz sx sy sz" 
  330.  
  331. Example:
  332. "PLN X 0.0 0.0 0.0 0.0 0.0 0.0 1 1 1"
  333.      
  334. 2) Cylinder  "CYL radius height rx ry rz tx ty tz sx sy sz"
  335.  
  336. Example:
  337. "CYL .2 1 0.0 0.0 0.0 0.0 0.0 0.0 1 1 1"
  338.  
  339. 3) Cone:     "CON radius height rx ry rz tx ty tz sx sy sz"
  340.  
  341. Example:
  342.    "CON .2 1 0.0 0.0 0.0 0.0 0.0 0.0 1 1 1"
  343.  
  344. 4) Sphere:   "SPH radius rx ry rz tx ty tz sx sy sz"
  345. (tx ty and tz are the center of the sphere)
  346. (sx sy sz must have the same value)
  347.  
  348. Example:
  349.    "SPH .5 0.0 0.0 0.0 0.0 0.0 0.0 1 1 1"
  350.  
  351. 5) Ellipsoid: "ELI xradius yradius zradius rx ry rz tx ty tz sx sy sz"
  352.  
  353. Example:
  354.    "ELI .5 .2 .3 0.0 0.0 0.0 0.0 0.0 0.0 1 1 1"
  355.    
  356. 6) Torus:     "TOR radius_major radius_minor rx ry rz tx ty tz sx sy sz" 
  357.  
  358. Example:
  359.    "TOR .7 .2 0.0 0.0 0.0 0.0 0.0 0.0 1 1 1"
  360.  
  361. 7) Box:       "BOX rx ry rz tx ty tz sizex sizey sizez"
  362. (the Box is a unit cube that has been scaled to size)
  363.  
  364. Example:
  365.    "BOX 0.0 0.0 0.0 0.0 0.0 0.0 1 2 .1"
  366.  
  367. 8) HeightField "HFL filename.ext rx ry rz tx ty tz sx sy sz"
  368. (POVCAD draws a pyramid to represent it, with dimensions x=1 y=1 z=1, 
  369.  so it must be scaled properly.  Check POV's docs on height_field.)
  370.  
  371. Example
  372.    "HFL mountain.gif 0.0 0.0 0.0 0.0 0.0 0.0 1000 1000 3245"
  373.  
  374. 9) RAW: "RAW filename.ext rx ry rz tx ty tz sx sy sz"
  375.    (Consider using Steve Anger's RAW2POV, it's more efficient. Don't
  376.     say I didn't tell you about it!)
  377. Example:
  378.     "RAW sweep.dat 0.0 0.0 0.0 0.5 1.3 0.0 1 1 1"
  379.  
  380.  
  381. 10) Sweep
  382.     (same as RAW only that the SWP keyword appears instead of RAW)
  383.  
  384.  
  385. 11) Path
  386.     "PTH filename.ext 0.0 0.0 0.0 0.0 0.0 0.0 1 1 1"
  387.     This command points to a file with the format:
  388.      p1.x p1.y p1.z
  389.      p2.x p2.y p2.z
  390.      ....ect .....
  391.     
  392.     which was created with POVCAD or that you made up yourself.
  393.  
  394. 12) Light Source
  395.     "LTS 0.0 0.0 0.0 X Y Z .25 .25 .25"
  396.     
  397.     Comments: 
  398.      * The first three number are not used at all.
  399.      * X Y Z refer to the light source position
  400.      * the three .25 values are scaling factors that only affect
  401.        the drawing on POVCAD.   You may change those numbers to
  402.        suit your needs by using the XFORM command (scale x,y,z).
  403.      * The light_source color is in the *.TEX file.
  404.  
  405.  
  406. The *.TEX file structure:
  407. The *.tex file has a line for every item in the *.cad file.  Some places
  408. may be empty but the file length is the same as the *.cad file.  If you
  409. created light_sources, the colors will appear here also.
  410.  
  411. The *.WRL file structure:
  412. This file has 4 values (if it's not found in your directory, POVCAD
  413. assumes a world definition of (-1,-1)-(1,1) ):
  414.  
  415. WXleft  WYbottom
  416. WXright WYtop
  417.  
  418. These values correspond to the YX plane view.
  419.  
  420. The *.PTH file structure
  421. This is a straight ASCII file with a list of 3D points:
  422.  
  423. p1.x p1.y p1.z
  424. p2.x p2.y p2.z
  425. ... ect...
  426.  
  427. The data has already been transformed by any operations you might have
  428. done inside POVCAD.
  429.  
  430.  
  431. Other Stuff
  432. --------------------------------------------------------------------
  433. Limits
  434. At this point up to 100 objects may be created.  You may do complicated
  435. objects by MERGEing files.  This will change on future versions.
  436.  
  437. CSG/COMPOSITE Objects
  438. You can not XFORM the whole CSG/COMPOSITE object...you may XFORM any of
  439. the components.
  440.  
  441. World Coordinates Definition:
  442. POVCAD starts with (-1,-1)-(1,1) => (lowerleftcorner)-(upperleftcorner).
  443. Click on View and then World to change that or use the ZoomIn/Out icons
  444. to scale up or down.  When you ZoomIn the world = world/scalefactor and 
  445. when you ZoomOut the world = world * scalefactor.  
  446.  
  447. Pan
  448. You can Pan(scroll) in all direction by clicking on the arrows.  You may
  449. change the Pan Step Size to move faster or slower. Experiment with it.
  450.  
  451. Copy
  452. The Copy function will create an exact copy of the current object. That
  453. means that it will be also in the SAME place as the original.  Then XFORM
  454. will be shown and select the transformation necessary to put the new object
  455. where it should be.  Click on redraw to refresh the screen if necessary.
  456.  
  457. Files
  458. The Export to POV creates a POV format file of the current scene.  The
  459. default name is POVCAD.OUT...the name can be changed.  It also creates 
  460. any path files (*.PTH) that are in memory.
  461.  
  462. AutoRedraw ON/OFF
  463. There's an icon to turn on/off the autoredraw feature.  With the option 
  464. on ON the drawing is sent to a buffer first and then appears on the screen.
  465. With the option on OFF the screen will be redraw everytime that you select
  466. the TEXTURE, SESSION or XFORM windows.  Experiment which one works best for you.
  467. The important point is that in ON you pay a price with memory.  Check
  468. with your system, you decide.
  469.  
  470. Things you must do on your own (Sorry!...at least for now)
  471. ---------------------------------------
  472. 1) "spotlight" light sources and camera will be missing from the files.  
  473. 2) If you forget to add textures to the objects you must add it later.
  474.    (you can always reload the session file and put them in)
  475.  
  476. Suggestions
  477. Create a standard view file with lightsources and camera and put
  478. somewhere the statement #include "myscene.pov" to include your scene.
  479. That's what I do and works OK for me.
  480.  
  481.  
  482. Your Suggestions
  483. I do welcome your comments and suggestions!  Registered users have a
  484. better chance of seeing their comments incorporated in the program.
  485. If you like it or not let me know!
  486.  
  487. ------------------------------------------------------------------------
  488.  
  489.     REGISTRATION FORM FOR POVCAD 1.0  (c) Alfonso Hermida 1993
  490.  
  491.                 COMPLETE THE REQUIRED INFORMATION
  492.                     Send check or money order to
  493.                          Alfonso Hermida
  494.                        9346 Kings Grant Rd
  495.                          Laurel MD 20723
  496.  
  497.  
  498. Name   :_________________________________         Date:_________
  499.  
  500. Address:________________________________________________________   
  501.  
  502.         ________________________________________________________
  503.  
  504.         ________________________________________________________
  505.  
  506.  
  507. Phone  :__________________________________
  508.  
  509.  
  510. Your registration entitles you to support thru Pi Square BBS.  Write
  511. a temporary password to add your account to the BBS:
  512.  
  513. BBS password: _________________________
  514.  
  515.  
  516. Would you be interested in the source code?  Yes[  ]   No[  ]
  517. (written in Visual Basic 2.0)
  518.  
  519. Comments:__________________________________________________________
  520.  
  521. ___________________________________________________________________
  522.  
  523. ___________________________________________________________________
  524.  
  525. ----------------------------------------------------------------------