home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / wps / graphic / povframe / povdoc.inf (.txt) < prev    next >
OS/2 Help File  |  1994-02-11  |  198KB  |  6,212 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Title Page ΓòÉΓòÉΓòÉ
  3.  
  4. Persistence of Vision Ray Tracer (POV-Ray) 
  5.  
  6. Version 2.0 
  7.  
  8. User's Documentation 
  9.  
  10. Copyright 1993 POV-Ray Team 
  11.  
  12.  
  13. ΓòÉΓòÉΓòÉ 2. 1.0  Introduction to POV-Ray ΓòÉΓòÉΓòÉ
  14.  
  15. This document details the use of the Persistence of Vision Ray Tracer (POV- 
  16. Ray) and is broken down into several sections. 
  17.  
  18. The first section describes the program POV-Ray, explains what ray tracing is 
  19. and also describes where to find the latest version of the POV-Ray software. 
  20.  
  21. The next section is a quick start that helps you quickly begin to use the 
  22. software. 
  23.  
  24. After the quick start is a more in-depth tutorial for beginning POV-Ray users. 
  25.  
  26. Following the beginning tutorial is a scene description language reference that 
  27. describes the language used with POV-Ray to create an image. 
  28.  
  29. The last sections include some tips and hints, suggested reading, and legal 
  30. information. 
  31.  
  32. POV-Ray is based on DKBTrace 2.12 by David Buck & Aaron A. Collins 
  33.  
  34.  
  35. ΓòÉΓòÉΓòÉ 3. 2.0  About POV-Ray ΓòÉΓòÉΓòÉ
  36.  
  37. This section describes POV-Ray and explains what a ray tracer does.  It also 
  38. describes where to find the latest version of the POV-Ray software. 
  39.  
  40.  
  41. ΓòÉΓòÉΓòÉ 3.1. 2.1  Program Description -- WHAT IS RAY TRACING? ΓòÉΓòÉΓòÉ
  42.  
  43. The Persistence of Vision Ray Tracer (POV-Ray) is a copyrighted freeware 
  44. program that allows a user to easily create fantastic, three dimensional, 
  45. photo-realistic images on just about any computer. POV-Ray reads standard ASCII 
  46. text files that describe the shapes, colors, textures and lighting in a scene 
  47. and mathematically simulates the rays of light moving through the scene to 
  48. produce a photo-realistic image! 
  49.  
  50. No traditional artistic or programming skills are required to use POV-Ray. 
  51. First, you describe a picture in POV-Ray's scene description language, then 
  52. POV-Ray takes your description and automatically creates an image from it with 
  53. near perfect shading, perspective, reflections and lighting. 
  54.  
  55. The standard POV-Ray package also includes a collection of sample scene files 
  56. that illustrate the program's features.  Additionally the POV-Ray Team 
  57. distributes several volumes of scenes that have been created by other artists 
  58. using the program. These scenes can be rendered and enjoyed even before 
  59. learning the scene description language. They can also be modified to create 
  60. new scenes. 
  61.  
  62. Here are some highlights of POV-Ray's features: 
  63.  
  64. o Easy to use scene description language 
  65.  
  66. o Large library of stunning example scene files 
  67.  
  68. o Standard include files that pre-define many shapes, colors and textures 
  69.  
  70. o Very high quality output image files (24-bit color.) 
  71.  
  72. o 15 and 24 bit color display on IBM-PC's using appropriate hardware 
  73.  
  74. o Create landscapes using smoothed height fields 
  75.  
  76. o Spotlights for sophisticated lighting 
  77.  
  78. o Phong and specular highlighting for more realistic-looking surfaces. 
  79.  
  80. o Several image file output formats including Targa, dump and raw 
  81.  
  82. o Wide range of shapes: 
  83.  
  84. o Basic Shape Primitives such as... Sphere, Box, Quadric, Cylinder, Cone, 
  85.   Triangle and Plane 
  86.  
  87. o Advanced Shape Primitives such as... Torus (Donut), Hyperboloid, Paraboloid, 
  88.   Bezier Patch, Height Fields (Mountains), Blobs, Quartics, Smooth Triangles 
  89.   (Phong shaded) 
  90.  
  91. o Shapes can easily be combined to create new complex shapes. This feature is 
  92.   called Constructive Solid Geometry (CSG). POV-Ray supports unions, merges, 
  93.   intersections and differences in CSG. 
  94.  
  95. o Objects are assigned materials called textures.  (A texture describes the 
  96.   coloring and surface properties of a shape.) 
  97.  
  98. o Built-in color patterns: Agate, Bozo, Checker, Granite, Gradient, Leopard, 
  99.   Mandel, Marble, Onion, Spotted, Radial, Wood and image file mapping. 
  100.  
  101. o Built-in surface bump patterns: Bumps, Dents, Ripples, Waves, Wrinkles and 
  102.   mapping. 
  103.  
  104. o Users can create their own textures or use pre-defined textures such as... 
  105.   Mirror, Metals like Chrome, Brass, Gold and Silver, Bright Blue Sky with 
  106.   Clouds, Sunset with Clouds, Sapphire Agate, Jade, Shiny, Brown Agate, 
  107.   Apocalypse, Blood Marble, Glass, Brown Onion, Pine Wood, Cherry Wood 
  108.  
  109. o Combine textures using layering of semi-transparent textures or tile or 
  110.   material map files. 
  111.  
  112. o Display preview of image while computing (not available on all computers) 
  113.  
  114. o Halt rendering when part way through 
  115.  
  116. o Continue rendering a halted partial scene later 
  117.  
  118.  
  119. ΓòÉΓòÉΓòÉ 3.2. 2.2  Which Version of POV-Ray should you use? ΓòÉΓòÉΓòÉ
  120.  
  121. There are specific versions of POV-Ray available for three different computers, 
  122. the IBM-PC, the Apple Macintosh, and the Commodore Amiga. 
  123.  
  124.  
  125. ΓòÉΓòÉΓòÉ 3.2.1. 2.2.1  IBM-PC's And Comapatibles ΓòÉΓòÉΓòÉ
  126.  
  127. The IBM-PC version is called POVRAY.EXE and is found in the self-extracting 
  128. archive POVIBM.EXE. It can be run on any IBM-PC with a 386 or 486 CPU and 2 
  129. megabytes of memory. A math co-processor is not required, but it is 
  130. recommended. This version of POV-Ray may be run under DOS, OS\2, and Windows. 
  131. It will not run under Desqview at this time. A version that runs on IBM-PC's 
  132. using the 286 CPU is also available in the self-extracting archive POV286.EXE. 
  133.  
  134.  
  135. ΓòÉΓòÉΓòÉ 3.2.2. 2.2.2  Apple Macintosh ΓòÉΓòÉΓòÉ
  136.  
  137. The Apple Macintosh version of POV-Ray can be found in the archive POVMAC.SEA 
  138. or POVMNF.SEA.  POVMAC.SEA contains the preferred "high- performance" 
  139. executable for Macs with a floating point coprocessor (FPU). POVMNF.SEA 
  140. contains the slower more universal executable, which will run on any 68020 or 
  141. better Mac without an FPU. 
  142.  
  143. The Macintosh version of POV-Ray needs a 68020 or better CPU (Mac II series, 
  144. SE/30, Quadras, some Powerbooks, etc.)  It will run under Sytem 6.0.4 or newer 
  145. (System 7 preferred.) It also requires 32 bit Color Quickdraw, which is built 
  146. into System 7, and is an optional init in System 6.  The init can be found on 
  147. the System 6 System disk "Printing", under the "Apple Color" folder.  It should 
  148. also be available from any authorized Apple Service Center, or CompuServe or 
  149. local Macintosh bulletin boards. QuickTime 1.5 or newer is preferred but not 
  150. required.  If installed, it will allow compression of the final PICT images. 
  151. It will also allow adding custom System 7 Thumbnail icons to the PICT files in 
  152. the Finder.  Of course, a color monitor is preferred, but not required. 
  153.  
  154.  
  155. ΓòÉΓòÉΓòÉ 3.2.3. 2.2.3  Commodore Amiga ΓòÉΓòÉΓòÉ
  156.  
  157. The Commodore Amiga version of POV-Ray can be found in the file POVAMI.LZH. Two 
  158. executables are supplied, one for computers with a math co-processor, and one 
  159. for computers without a math co-processor. This version will run on Amiga 500, 
  160. 1000, 2000, and 3000's and should work under AmigaDOS 1.3 or 2.xx.  The Amiga 
  161. version supports HAM mode as well as HAM-E and the Firecracker. 
  162.  
  163.  
  164. ΓòÉΓòÉΓòÉ 3.2.4. 2.2.4  UNIX And Other Systems ΓòÉΓòÉΓòÉ
  165.  
  166. POV-Ray is written in highly portable C source code and it can be compiled and 
  167. run on many different computers.  There is specific source code in the source 
  168. archive for UNIX, X-Windows, VAX, and generic computers. If you have one of 
  169. these, you can use the C compiler included with your operating system to 
  170. compile a POV-Ray executable for your own use. This executable may not be 
  171. distributed except under the terms specified in the file POVLEGAL.DOC.  Users 
  172. on high powered computers like Suns, SGI, RS-6000's, Crays, and so on use this 
  173. method to run POV-Ray. 
  174.  
  175.  
  176. ΓòÉΓòÉΓòÉ 3.2.5. 2.2.5  ALL Versions ΓòÉΓòÉΓòÉ
  177.  
  178. All versions of the program share the same ray tracing features like shapes, 
  179. lighting and textures. In other words, an IBM-PC can create the same pictures 
  180. as a Cray supercomputer as long as it has enough memory. 
  181.  
  182. The user will want to get the executable that best matches their computer 
  183. hardware. See the section "Where to find POV-Ray files" for where to find these 
  184. files. You can contact those sources to find out what the best version is for 
  185. you and your computer. 
  186.  
  187.  
  188. ΓòÉΓòÉΓòÉ 3.3. 2.3  Where to Find POV-Ray Files ΓòÉΓòÉΓòÉ
  189.  
  190. POV-Ray is a complex piece of software made up of many files. The POV-Ray 
  191. package is made up of several archives including executables, documentation, 
  192. and example scene files. 
  193.  
  194. The average user will need an executable for their computer, the example scene 
  195. files and the documentation. The example scenes are invaluable for learning 
  196. about POV-Ray, and they include some exciting artwork. 
  197.  
  198. Advanced users, developers, or the curious may want to download the C source 
  199. code as well. 
  200.  
  201. There are also many different utilities for POV-Ray that generate scenes, 
  202. convert scene information from one format to another, create new materials, and 
  203. so on. You can find these files from the same sources as the other POV- Ray 
  204. files. No comprehensive list of these utilities is available at the time of 
  205. this writing. 
  206.  
  207. The latest versions of the POV-Ray software are available from these sources: 
  208.  
  209.  
  210. ΓòÉΓòÉΓòÉ 3.3.1. 2.3.1  GRAPHICS DEVELOPER'S FORUM On CompuServe ΓòÉΓòÉΓòÉ
  211.  
  212. POV-Ray headquarters are on CompuServe Graphics Developer's Forum (GO GRAPHDEV) 
  213. sections 8 POV Sources and 9 POV Images. We meet there to share info and 
  214. graphics and discuss ray tracing. The forum is also home to development 
  215. projects on fractals, animation and morphing.  It is the home of the Stone Soup 
  216. Group, developers of Fractint, a popular IBM-PC fractal program. Everyone is 
  217. welcome to join in on the action on CIS GraphDev. Hope to see you there! You 
  218. can get information on joining CompuServe by calling (800)848-8990. CompuServe 
  219. access is also available in Japan, Europe and many other countries. 
  220.  
  221.  
  222. ΓòÉΓòÉΓòÉ 3.3.2. 2.3.2  PC GRAPHICS Area On America On-Line ΓòÉΓòÉΓòÉ
  223.  
  224. There's an area now on America On-Line dedicated to POV-Ray support and 
  225. information. You can find it in the PC Graphics section of AOL. Jump keyword 
  226. "PCGRAPHICS". This area includes the Apple Macintosh executables also. 
  227.  
  228.  
  229. ΓòÉΓòÉΓòÉ 3.3.3. 2.3.3  YOU CAN CALL ME RAY BBS In Chicago ΓòÉΓòÉΓòÉ
  230.  
  231. There is a ray trace specific BBS in the (708) Area Code (Chicago suburbia, 
  232. United States) for all you Traceaholics out there. The phone number of this BBS 
  233. is (708) 358-5611. Bill Minus is the sysop and Aaron Collins is co- sysop of 
  234. that board, and it's filled with interesting stuff. 
  235.  
  236.  
  237. ΓòÉΓòÉΓòÉ 3.3.4. 2.3.4  THE GRAPHICS ALTERNATIVE BBS In EL Cerrito, CA ΓòÉΓòÉΓòÉ
  238.  
  239. For those on the West coast, you may want to find the POV-Ray files on The 
  240. Graphics Alternative BBS. It's a great graphics BBS run by Adam Shiffman. TGA 
  241. is high quality, active and progressive BBS system which offers both quality 
  242. messaging and files to its 1300+ users. 
  243.  
  244.         510-524-2780 (PM14400FXSA v.32bis 14.4k, Public)
  245.         510-524-2165 (USR DS v.32bis/HST 14.4k, Subscribers)
  246.  
  247.  
  248. ΓòÉΓòÉΓòÉ 3.3.5. 2.3.5  PI SQUARED BBS In Maryland ΓòÉΓòÉΓòÉ
  249.  
  250. For those on the East coast you may want to try th Pi Squared BBS in Maryland. 
  251. The sysop Alfonso Hermida CIS: 72114,2060 is the creator of POVCAD.  He carries 
  252. the latest POV files and utilities, plus supports his software.  Call 
  253. (301)-725-9080 in Maryland USA running @ 14.4K bps 24 hrs. 
  254.  
  255.  
  256. ΓòÉΓòÉΓòÉ 3.3.6. 2.3.6  INTERNET ΓòÉΓòÉΓòÉ
  257.  
  258. The POV-Ray files are also available over Internet by anonymous FTP from 
  259. alfred.ccs.carleton.ca (134.117.1.1). 
  260.  
  261.  
  262. ΓòÉΓòÉΓòÉ 4. 3.0  Quick Start ΓòÉΓòÉΓòÉ
  263.  
  264. The next section describes how to quickly install POV-Ray and render a sample 
  265. scene on your computer. 
  266.  
  267.  
  268. ΓòÉΓòÉΓòÉ 4.1. 3.1  Installing POV-Ray ΓòÉΓòÉΓòÉ
  269.  
  270. Specific installation instructions are included with the executable program for 
  271. your computer. In general, there are two ways to install POV-Ray. 
  272.  
  273. [ Note that the generic word "directory" is used throughout.  Your operating 
  274. system may use another word (subdirectory, folder, etc.) ] 
  275.  
  276. 1-- The messy way: Create a directory called POVRAY and copy all POV-Ray files 
  277. into it. Edit and run all files and programs from this directory. This method 
  278. works, but is not recommended. 
  279.  
  280. Or the preferred way: 
  281. 2-- Create a directory called POVRAY and several subdirectories called INCLUDE, 
  282. DEMO, SCENES, UTIL. The self-extracting archives used in some versions of the 
  283. program will create subdirectories for you.  If you create your own, the file 
  284. tree for this should look something like this: 
  285.  
  286.         \--
  287.           |
  288.           +POVRAY --
  289.                    |
  290.                    +INCLUDE
  291.                    |
  292.                    +DEMO
  293.                    |
  294.                    +SCENES
  295.                    |
  296.                    +UTIL
  297.  
  298. Copy the executable file and docs into the directory POVRAY. Copy the standard 
  299. include files into the subdirectory INCLUDE. Copy the sample scene files into 
  300. the subdirectory SCENES. And copy any POV-Ray related utility programs and 
  301. their related files into the subdirectory UTIL. Your own scene files will go 
  302. into the SCENES subdirectory. Also, you'll need to add the directories \POVRAY 
  303. and \POVRAY\UTIL to your "search path" so the executable programs can be run 
  304. from any directory. 
  305.  
  306.         *Note that some operating systems don't
  307.         *have an equivalent to the
  308.         *multi-path search command.
  309.  
  310. The second method is a bit more difficult to set-up, but is preferred. There 
  311. are many files associated with POV-Ray and they are far easier to deal with 
  312. when separated into several directories. 
  313.  
  314.  
  315. ΓòÉΓòÉΓòÉ 4.2. 3.2  Using Sample Scenes ΓòÉΓòÉΓòÉ
  316.  
  317. This section describes how to render a sample scene file. You can use these 
  318. steps to render any of the sample scene files included in the sample scenes 
  319. archive. 
  320.  
  321. A scene file is a standard ASCII text file that contains a description of a 
  322. three dimensional scene in the POV-Ray language.  The scene file text describes 
  323. objects and lights in the scene, and a camera to view the scene. Scene files 
  324. have the file extension .POV and can be created by any word processor or editor 
  325. that can save in standard ASCII text format. 
  326.  
  327. Quite a few example scenes are provided with this distribution in the example 
  328. scenes archive. The scenes in the standard archives are designed to illustrate 
  329. and teach you the features of the program.  Additionally the POV-Ray Team 
  330. distributes several volumes of scenes in its ongoing series "The POV-Ray Scene 
  331. Library"  These scene files range from very simple to very complex. They have 
  332. been created by users of POV-Ray all over the world, and were picked to give 
  333. examples of the variety of features in POV- Ray. Many of them are stunning in 
  334. their own right. 
  335.  
  336. The scenes were graciously donated by the artists because they wanted to share 
  337. what they had created with other users. Feel free to use these scenes for any 
  338. purpose. You can just marvel at them as-is, you can study the scene files to 
  339. learn the artists techniques, or you can use them as a starting point to create 
  340. new scenes of your own. 
  341.  
  342. Here's how to make these sample scenes into images you can view on your 
  343. computer. We'll use SIMPLE.POV as an example, just substitute another filename 
  344. to render a different image. 
  345.  
  346.   Note: The sequence of commands is not the same for
  347.         every version of POV-Ray. There should be a
  348.         document with the executable describing the
  349.         specific commands to render a file.
  350.  
  351. The file SIMPLE.POV was included with the standard scene files and should now 
  352. be in the DEMO directory.  Make that the active directory, and then at the 
  353. command line, type: 
  354.  
  355.         POVRAY +Isimple.pov +V +W80 +H60
  356.  
  357. POVRAY is the name of your executable, +Ifilename.pov tells POV-Ray what scene 
  358. file it should use as input, and +V tells the program to output its status to 
  359. the text screen as it's working. +W and +H set the width and height of the 
  360. image in pixels. This image will be 80 pixels wide by 60 pixels high. 
  361.  
  362. POV-Ray will read in the text file SIMPLE.POV and begin working to render the 
  363. image. It will write the image to a file called DATA.TGA. The file DATA.TGA 
  364. contains a 24 bit image of the scene file SIMPLE.POV. Because many computers 
  365. can't display a 24 bit image, you will probably have to convert DATA.TGA to an 
  366. 8 bit format before you can view it on your computer. The docs included with 
  367. your executable lists the specific steps required to convert a 24 bit file to 
  368. an 8 bit file. 
  369.  
  370.  
  371. ΓòÉΓòÉΓòÉ 4.3. 3.3  Command Line Parameters ΓòÉΓòÉΓòÉ
  372.  
  373. The following section gives a detailed description of the command-line options. 
  374.  
  375. The command-line parameters may be specified in any order. Repeated parameters 
  376. overwrite the previous values except for the +L switch which defines include 
  377. file library paths.  Up to 10 +L paths may be specified. Default parameters may 
  378. also be specified in a file called "povray.def" or by the environment variable 
  379. "POVRAYOPT". 
  380.  
  381. Switches may be specified in upper or lower case.  Switches must be preceded by 
  382. a + (plus) or - (minus).  In switches which toggle a feature, the plus turns it 
  383. on and minus turns it off.  For example +P turns on the "pause for keypress 
  384. when finished" option while -P turns it off.  Other switches are used to 
  385. specify values and do not toggle a feature.  Either plus or minus may be used 
  386. in that instance.  For example +W320 sets the width to 320 pixels.  You could 
  387. also use -W320 and get the same results. More examples follow this table. 
  388.  
  389.   Table 1 Command Line Parameters
  390.   Parameter......|.....Range........|...Description........................
  391.   -------------------------------------------------------------------------
  392.   +Annn          | 0.0 to 3.0       | Render picture with anti-aliasing,or
  393.                  |                  | "smoothing", on.  Lower values cause
  394.                  |                  | more smoothing.
  395.   +A             |                  | Use default 0.3 anti-aliasing
  396.   -A             |                  | Turn anti-aliasing off (default)
  397.   +Bnnn or -Bnnn | Varies w/ sys    | Output file buffer size.
  398.   +C             |                  | Continue an aborted partial image.
  399.   -C             |                  | Start rendering from first line.
  400.   +Dxxx          | Varies w/sys     | Display image graphically while
  401.                  |                  | rendering (Not available on all vers).
  402.   +Enn or +ERnn  | 1 to 32,767      | End row for tracing
  403.                  |  or 0.0 to 1.0   | a portion of a scene.
  404.   +ECnn          | 1 to 32,767      | End column for tracing
  405.                  |  or 0.0 to 1.0   | a portion of a scene.
  406.   +FT            |                  | Output Targa format file
  407.   +FD            |                  | Output dump format file
  408.   +FR            |                  | Output raw format file
  409.   -F             |                  | Disable file output.
  410.   +Hnnn          | 1 to 32,767      | Height of image in pixels.
  411.   +Ifilespec     | Varies w/ sys    | Input scene file name, generally ends
  412.                  |                  | in .pov.
  413.   +Jnnn.nnn      | 0.0 to 1.0       | Set amount of jitter for anti-aliasing
  414.   +J             |                  | Use anti-aliasing jitter 1.0 (default)
  415.   -J             |                  | Turn off anti-aliasing jitter
  416.   +Knnn.nnn      | any real value   | Set "clock" float value for animation
  417.   +Lpathspec     | Varies w/ sys    | Library path: POV-Ray will search for
  418.                  |                  | files in the directory listed here.
  419.                  |                  | Multiple lib paths may be specified.
  420.   -MB            |                  | Turn off bounding slabs
  421.   +MBnnn         | 0 to 32,767      | Use bounding slabs if more than nnn
  422.                  |                  | objects in scene.
  423.   +MSnnn         | 300 or more      | Set symbol table size (default 1000)
  424.   +MVn.m         | 1.0 or 2.0       | Set version compatibility mode
  425.   +Ofilespec     | Varies w/ sys    | Output image filename.
  426.   +P             |                  | Pause and wait for keypress after
  427.                  |                  | tracing image.
  428.   -P             |                  | Don't pause
  429.   +Qn            |   0 to 9         | Image quality: 9 highest(default) to
  430.                  |                  | 0 lowest.
  431.   +Rn or -Rn     |   1 to 9         | Use n*n rays for anti-aliasing. Default
  432.                  |                  | of 3 gives 9 rays; 4 gives 16 rays etc.
  433.   +Snn or +SRnn  | 1-32,768         | Start row for tracing
  434.                  |  or 0.0 to 1.0   | a portion of a scene.
  435.   +SCnn          | 1-32,768         | Start column for tracing
  436.                  |  or 0.0 to 1.0   | a portion of a scene.
  437.   +Vnn           | Varies w/sys     | Display verbose image stats while
  438.                  |                  | rendering.
  439.   -V             |                  | No stats during rendering
  440.   +Wnnn          | 1-32,768         | Width of image in pixels.
  441.   +X             |                  | Allow abort with keypress.(IBM-PC).
  442.   -X             |                  | Disable abort with keypress.(IBM-PC).
  443.   --------------------------------------------------------------
  444.  
  445.  
  446. ΓòÉΓòÉΓòÉ 4.3.1. 3.3.1  Anti-Aliasing ΓòÉΓòÉΓòÉ
  447.  
  448.         +Annn       Anti-alias with tolerance level nnn.
  449.         +A          Anti-alias with tolerance level 0.3
  450.         -A          Don't anti-alias (default)
  451.         +Jn.nn      Scale factor for jittering
  452.         +J          Jitter AA with scale 1.0 (default)
  453.         -J          Turn off jittering
  454.         +Rn or -Rn  Use n*n rays when anti-aliasing (default 3)
  455.  
  456. Anti-aliasing is a technique used to make the ray traced image look smoother. 
  457. Often the color difference between two objects creates a "jaggy" appearance. 
  458. When anti-aliasing is turned on, POV-Ray attempts to "smooth" the jaggies by 
  459. shooting more rays into the scene and averaging the results. This technique can 
  460. really improve the appearance of the final image. Be forewarned though, 
  461. anti-aliasing drastically slows the time required to render a scene since it 
  462. has do many more calculations to "smooth" the image. Lower numbers mean more 
  463. anti-aliasing and also more time. Use anti- aliasing for your final version of 
  464. a picture, not the rough draft. 
  465.  
  466. The +A option enables adaptive anti-aliasing. The number after the +A option 
  467. determines the threshold for the anti-aliasing. 
  468.  
  469. If the color of a pixel differs from its neighbor (to the left or above) by 
  470. more than the threshold, then the pixel is subdivided and super-sampled. If 
  471. r1,g1,b1 and r2,g2,b2 are the rgb components of two pixels then the difference 
  472. between pixels is computed by: 
  473.  
  474.         diff=abs(r1-r2)+abs(g1-g2)+abs(b1-b2)
  475.  
  476. The rgb values are in the range 0.0 to 1.0 thus the most two pixels can differ 
  477. is 3.0.  If the anti-aliasing threshold is 0.0, then every pixel is 
  478. super-sampled. If the threshold is 3.0, then no anti-aliasing is done. 
  479.  
  480. The lower the contrast, the lower the threshold should be. Higher contrast 
  481. pictures can get away with higher tolerance values. 
  482.  
  483. Good values seem to be around 0.2 to 0.4. 
  484.  
  485. The super-samples are jittered to introduce noise and to eliminate moire 
  486. interference patterns. Note that the jittering "noise" is non-random and 
  487. repeatable in nature, based on an object's 3-D orientation in space. Thus, it's 
  488. okay to use anti-aliasing for animation sequences, as the anti-aliased pixels 
  489. won't vary and flicker annoyingly from frame to frame. The +Jnn.nn switch 
  490. scales down the amount of jitter from its default value 1.0. For example +J0.5 
  491. uses half the normal jitter.  Values over 1.0 jitter outside the pixel bounds 
  492. and are not recommended.  Use -J to turn off jittering. 
  493.  
  494. The +R switch controls the number of rows and columns of rays per pixel with 
  495. anti-aliasing.  The default value 3 gives 3x3=9 rays per pixel. 
  496.  
  497. The jittering and multiple rays are only used when +A is on. 
  498.  
  499.  
  500. ΓòÉΓòÉΓòÉ 4.3.2. 3.3.2  Buffering ΓòÉΓòÉΓòÉ
  501.  
  502.         +Bnnn       Use an output file buffer of nnn kilobytes.
  503.         -Bnnn       Same as +Bnnn
  504.  
  505. The +B option allows you to assign large buffers to the output file. This 
  506. reduces the amount of time spent writing to the disk. If this parameter is not 
  507. specified, then as each scanline is finished, the line is written to the file 
  508. and the file is flushed. On most systems, this operation insures that the file 
  509. is written to the disk so that in the event of a system crash or other 
  510. catastrophic event, at least part of the picture has been stored properly and 
  511. retrievable on disk. (see also the +C option below.)  A value of +B30 is a good 
  512. value to use to speed up small renderings.  A value of +B0 defaults to a small 
  513. system-dependent buffer size. Note neither +B0 nor -B turns this feature off. 
  514. Once a buffer is set, subsequent +B commands can change its size but cannot 
  515. turn it off. 
  516.  
  517.  
  518. ΓòÉΓòÉΓòÉ 4.3.3. 3.3.3  Continuing An Interrupted Trace ΓòÉΓòÉΓòÉ
  519.  
  520.         +C          Continue partially complete rendering
  521.         -C          Render from beginning (default)
  522.  
  523. If you abort a render while it's in progress or if you used the +E or +ER 
  524. options to end the render prematurely, you can use the +C option to continue 
  525. the render when you get back to it. This option reads in the previously 
  526. generated output file, displays the image to date on the screen, then proceeds 
  527. with the ray tracing. This option cannot be used if file output is disabled 
  528. with -F.  It does not work with +S, +SR, +SC or +EC switches. 
  529.  
  530.  
  531. ΓòÉΓòÉΓòÉ 4.3.4. 3.3.4  Display Preview Image ΓòÉΓòÉΓòÉ
  532.  
  533.         +D          Use preview display
  534.         -D          Turn preview display off (default)
  535.  
  536. If the +D option is used and your computer supports a graphic display, then the 
  537. image will be displayed while the program performs the ray tracing. On most 
  538. systems, the picture displayed is not as good as the one created by the 
  539. post-processor because it does not try to make optimum choices for the color 
  540. registers. 
  541.  
  542. The +D parameters are system-dependent and are listed in the executable 
  543. documentation. 
  544.  
  545.  
  546. ΓòÉΓòÉΓòÉ 4.3.5. 3.3.5  Render Partial Image ΓòÉΓòÉΓòÉ
  547.  
  548.         +Snnn or +SRnnn   Start tracing at row number nnn.
  549.         +SCnnn            Start tracing at column number nnn.
  550.         +Ennn or +ERnnn   End tracing at row number nnn.
  551.         +ECnnn            End tracing at column number nnn.
  552.  
  553. When doing test rendering it is often convenient to define a rectangular 
  554. section of the whole screen so you can quickly check out one area of the image. 
  555. The +S and +E switches let you define starting and ending rows and columns for 
  556. partial renderings. 
  557.  
  558. The +S and +E options also allow you to begin and end the rendering of an image 
  559. at a specific scan line so you can render groups of scanlines on different 
  560. systems and concatenate them later. 
  561.  
  562. WARNING: Image files created on with different executables on the same or 
  563. different computers may not look exactly the same due to different random 
  564. number generators used in some textures. If you are merging output files from 
  565. different systems, make sure that the random number generators are the same. If 
  566. not, the textures from one will not blend in with the textures from the other. 
  567.  
  568. Note if the number following +SR, +SC, +ER or +EC is a greater 1 then it is 
  569. interpreted as a number of pixels.  If it is a decimal value between 0.0 and 
  570. 1.0 then it is interpreted as a percent of the total width or height of the 
  571. image.  For example: +SR0.75 +SC0.75 starts on a row 75% down from the top at a 
  572. column 75% from the left and thus renders only the lower-right 25% of the 
  573. image. 
  574.  
  575.  
  576. ΓòÉΓòÉΓòÉ 4.3.6. 3.3.6  File Output Type ΓòÉΓòÉΓòÉ
  577.  
  578.         +FT         Uncompressed Targa-24 format (IBM-PC Default)
  579.         +FD         Dump format (QRT-style)
  580.         +FR         Raw format - one file each for Red, Green and Blue.
  581.         +F          Use default file type for your system
  582.         -F          Turn off file output
  583.  
  584. Normally, you don't need to specify any form of +F option. The default setting 
  585. will create the correct format image file for your computer. The docs included 
  586. with the executable specify which format is used. 
  587.  
  588. You can disable image file output by using the command line option -F. This is 
  589. only useful if your computer has display options and should be used in 
  590. conjunction with the +P option. If you disable file output using -F, there will 
  591. be no record kept of the image file generated. This option is not normally 
  592. used. 
  593.  
  594. Unless file output is disabled (-F) POV-Ray will create an image file of the 
  595. picture. This output file describes each pixel with 24 bits of color 
  596. information. Currently, three output file formats are directly supported. They 
  597. are +FT - Uncompressed Targa-24 format (IBM-PC Default), +FD - Dump format 
  598. (QRT-style) and +FR - Raw format - one file each for Red, Green and Blue. 
  599.  
  600.  
  601. ΓòÉΓòÉΓòÉ 4.3.7. 3.3.7  Height And Width of Rendered Image ΓòÉΓòÉΓòÉ
  602.  
  603.         +Hnnn or -Hnnn    Set height of image in pixels
  604.         +Wnnn or -Wnnn    Set width of image in pixels
  605.  
  606. These switches set the height and width of the image in pixels.  This specifies 
  607. the image size for file output.  The preview display with the +D option will 
  608. generally attempt to pick a video mode to accommodate this size but the +D 
  609. settings do not in any way affect the resulting file output. 
  610.  
  611.  
  612. ΓòÉΓòÉΓòÉ 4.3.8. 3.3.8  Input And Output File Names ΓòÉΓòÉΓòÉ
  613.  
  614.         +Ifilename  Set the input filename
  615.         +Ofilename  Set output filename
  616.  
  617. The default input filename is "object.pov". The default output filename is 
  618. "data" and the suffix for your default file type.  The +O switch has no effect 
  619. unless file output is turned on with +F 
  620.  
  621. IBM-PC default file type is Targa, so the file is "data.tga". 
  622.  
  623. Amiga uses dump format and the default outfile name is "data.dis". 
  624.  
  625. Raw mode writes three files, "data.red", "data.grn" and "data.blu". On IBM- 
  626. PC's, the default extensions for raw mode are ".r8", ".g8", and ".b8" to 
  627. conform to Piclab's "raw" format. Piclab is a widely used free-ware image 
  628. processing program. Normally, Targa files are used with Piclab, not raw files. 
  629.  
  630.  
  631. ΓòÉΓòÉΓòÉ 4.3.9. 3.3.10  Animation Clock Variable ΓòÉΓòÉΓòÉ
  632.  
  633.         +Knnn or -Knnn    Set the "clock" float value
  634.  
  635. The +K switch may be used to pass a single float value to the program for basic 
  636. animation.  The value is stored in the float identifier "clock".  If an object 
  637. had a "rotate <0,clock,0>" attached then you could rotate the object by 
  638. different amounts over different frames by setting +K10, +K20... etc. on 
  639. successive renderings. 
  640.  
  641.  
  642. ΓòÉΓòÉΓòÉ 4.3.10. 3.3.11  Librabry Search Path ΓòÉΓòÉΓòÉ
  643.  
  644.         +Lpathspec  Specify on of 10 library search paths
  645.  
  646. The +L option may be used to specify a "library" pathname to look in for 
  647. include, parameter and image files. Multiple uses of the +L switch do not 
  648. override previous settings.  Up to ten +L options may be used to specify a 
  649. search path. The home (current) directory will be searched first followed by 
  650. the indicated library directories in order. 
  651.  
  652.  
  653. ΓòÉΓòÉΓòÉ 4.3.11. 3.3.12  Bounding Slabs Control ΓòÉΓòÉΓòÉ
  654.  
  655.         -MB         Turn off bounding slabs
  656.         +MBnnn      Use bounding slabs if more than nnn objects in scene.
  657.  
  658. New in POV-Ray 2.0 is a spatial sub-division system called bounding slabs. It 
  659. compartmentalizes all of the objects in a scene into rectangular slabs and 
  660. computes which slabs a particular ray hits before testing the objects within 
  661. the slab.  This can greatly improve rendering speed.  However for scenes with 
  662. only a few objects the overhead of using slabs is not worth the effort.  The 
  663. +MB switch sets the minimum number of objects before slabs are used.  The 
  664. default is +MB25.  The -MB switch turns off slabs completely. 
  665.  
  666.  
  667. ΓòÉΓòÉΓòÉ 4.3.12. 3.3.13  Symbol Table Size ΓòÉΓòÉΓòÉ
  668.  
  669.         +MSnnn or -MSnnn        Sets symbol table size (default 1000)
  670.  
  671. POV-Ray allocates a fixed number of spaces in its symbol table for declared 
  672. identifiers.  The default of 1000 may be increased if you get a "Too many 
  673. symbols" error message. 
  674.  
  675.  
  676. ΓòÉΓòÉΓòÉ 4.3.13. 3.3.14  Version Comaptibility Mode ΓòÉΓòÉΓòÉ
  677.  
  678.         +MVn.n or -MVn.n        Set version compatibility mode
  679.  
  680. While many language changes have been made for POV-Ray 2.0, most version 1.0 
  681. syntax still works.  One new feature in 2.0 that is incompatible with any 1.0 
  682. scene files is the parsing of float expressions.  Setting +MV1.0 turns off 
  683. expression parsing as well as many warning messages so that nearly all 1.0 
  684. files will still work.  The "#version" language directive also can be used to 
  685. change modes within scene files.  The +MV switch affects only the initial 
  686. setting. 
  687.  
  688.  
  689. ΓòÉΓòÉΓòÉ 4.3.14. 3.3.15  Pause When Finished ΓòÉΓòÉΓòÉ
  690.  
  691.         +P          Pause when image is complete so preview image can
  692.                     be seen.
  693.         -P          Do not pause.  (default)
  694.  
  695. Normally when preview display is on you want to look at the image awhile before 
  696. continuing.  The +P switch pauses and waits for you to press a key before going 
  697. on. 
  698.  
  699.  
  700. ΓòÉΓòÉΓòÉ 4.3.15. 3.3.16  Quality Settings ΓòÉΓòÉΓòÉ
  701.  
  702.         +Qn or -Qn  Set rendering quality
  703.  
  704. The +Q option allows you to specify the image rendering quality, for quickly 
  705. rendering images for testing. You may also use -Q with no difference.  The 
  706. parameter can range from 0 to 9. The values correspond to the following quality 
  707. levels: 
  708.  
  709.         0,1  Just show quick colors. Ambient lighting only.
  710.              Quick colors are used only at 5 or below.
  711.         2,3  Show Diffuse and Ambient light
  712.         4,5  Render shadows, use extended lights at 5 but not 4
  713.         6,7  Create surface textures
  714.         8,9  Compute reflected, refracted, and transmitted rays.
  715.  
  716. The default is +Q9 (maximum quality) if not specified. 
  717.  
  718.  
  719. ΓòÉΓòÉΓòÉ 4.3.16. 3.3.17  Verbose Statistics ΓòÉΓòÉΓòÉ
  720.  
  721.         +V          Verbose statistics on
  722.         -V          Verbose statistics off
  723.  
  724. When the +D option is not used, it is often desirable to monitor progress of 
  725. the rendering.  The +V switch turns on verbose reporting while -V turns it off. 
  726. The format of the output is system dependent. 
  727.  
  728.  
  729. ΓòÉΓòÉΓòÉ 4.3.17. 3.3.18  Allow Abort During Rendering ΓòÉΓòÉΓòÉ
  730.  
  731.         +X          Allow abort with keypress
  732.         -X          Disable abort with keypress
  733.  
  734. On the IBM-PC versions only, when you specify the +X switch then any keypress 
  735. will abort rendering.  The -X switch disables this feature. 
  736.  
  737.  
  738. ΓòÉΓòÉΓòÉ 4.4. 3.4  Default Parameter File and Environment Variables ΓòÉΓòÉΓòÉ
  739.  
  740. You may specify the default parameters by modifying the file "povray.def" which 
  741. contains the parameters in the above format. This filename contains a complete 
  742. command line as though you had typed it in, and is processed before any options 
  743. supplied on the command line are recognized. You may put commands on more than 
  744. one line in the "povray.def" file. 
  745.  
  746. Examples: 
  747.  
  748.         POVRAY +Ibox.pov +Obox.tga +V +X +W320 +H200
  749.  
  750.         +Ibox.pov = Use the scene file box.pov for input
  751.         +Obox.tga = Output the image as a Targa file to box.tga
  752.         +V = Show line numbers while rendering.
  753.         +X = Allow key press to abort render.
  754.         +W320 = Set image width to 320 pixels
  755.         +H200 = Set image height to 200 pixels
  756.  
  757. Some of these parameters could have been put in the POVRAYOPT environment 
  758. variable to save typing: 
  759.  
  760.         SET POVRAYOPT = +V +X +W320 +H200
  761.  
  762. Then you could just type: 
  763.  
  764.         POVRAY +Ibox.pov +Obox.tga
  765.  
  766. Or, you could create a file called POVRAY.DEF in the same directory as the 
  767. scene file.  If POVRAY.DEF contains "+V +X +W320 +H200" then you could also 
  768. type: 
  769.  
  770.         POVRAY +Ibox.pov +Obox.tga
  771.  
  772. With the same results. You could also create an option file with a different 
  773. name and specify it on the command line: 
  774.  
  775. For example, if QUICK.DEF contains "+V +X +W80 +H60" then you could also type: 
  776.  
  777.         POVRAY +Ibox.pov +Obox.tga QUICK.DEF
  778.  
  779. When POV-Ray sees QUICK.DEF, it will read it in just as if you typed it on the 
  780. command line. 
  781.  
  782. The order that the options are read in for the IBM-PC version are as follows: 
  783.  
  784.         POVRAYOPT environment variable
  785.  
  786.         POVRAY.DEF in current directory or, if not found,
  787.                    in library path.
  788.  
  789.         Command line and command line option files
  790.  
  791. For example, +V in POVRAY.DEF would override -V in POVRAYOPT. +X on the command 
  792. line would override -X in POVRAY.DEF and so on. 
  793.  
  794. Other computer's versions may read in the POVRAY.DEF file before the POVRAYOPT 
  795. environment variable.  See the documentation on your version. 
  796.  
  797.  
  798. ΓòÉΓòÉΓòÉ 5. 4.0  Beginning Tutorial ΓòÉΓòÉΓòÉ
  799.  
  800. This section describes how to create a scene using POV-Ray's scene description 
  801. language and how to render this scene. 
  802.  
  803.  
  804. ΓòÉΓòÉΓòÉ 5.1. 4.1  Your First Image ΓòÉΓòÉΓòÉ
  805.  
  806. Let's create the scene file for a simple picture. Since ray tracers thrive on 
  807. spheres, that's what we'll render first. 
  808.  
  809.  
  810. ΓòÉΓòÉΓòÉ 5.1.1. 4.1.1  The POV-Ray Coordinate System ΓòÉΓòÉΓòÉ
  811.  
  812. First, we have to tell POV-Ray where our camera is and where it's looking. To 
  813. do this, we use 3D coordinates. The usual coordinate system for POV-Ray has the 
  814. positive Y axis pointing up, the positive X axis pointing to the right, and the 
  815. positive Z axis pointing into the screen as follows: 
  816.  
  817.             ^+Y
  818.             |   /+Z
  819.             |  /
  820.             | /
  821.             |/        +X
  822.             |-------->
  823.  
  824. The negative values of the axes point the other direction, as follows: 
  825.  
  826.             ^+Y
  827.             |   /+Z
  828.             |  /
  829.             | /
  830.     -X      |/        +X
  831.     <-------|-------->
  832.            /|
  833.           / |
  834.          /  |
  835.       -Z/   |
  836.             v-Y
  837.  
  838.  
  839. ΓòÉΓòÉΓòÉ 5.1.2. 4.1.2  Adding Standard Include Files ΓòÉΓòÉΓòÉ
  840.  
  841. Using your personal favorite text editor, create a file called "picture1.pov". 
  842. Now, type in the following (Note: The input is case sensitive, so be sure to 
  843. get capital and lowercase letters correct): 
  844.  
  845.         #include "colors.inc"    // The include files contain
  846.         #include "shapes.inc"    // pre-defined scene elements
  847.         #include "textures.inc"
  848.  
  849.         camera {
  850.           location  <0, 2, -3>
  851.           look_at   <0, 1,  2>
  852.         }
  853.  
  854. The first include statement reads in definitions for various useful colors. The 
  855. second and third include statements read in some useful shapes and textures 
  856. respectively. When you get a chance, have a look through them to see but a few 
  857. of the many possible shapes and textures available. 
  858.  
  859. You may have as many include files as needed in a scene file. Include files may 
  860. themselves contain include files, but you are limited to declaring includes 
  861. nested only 10 "deep". 
  862.  
  863. Filenames specified in the include statements will be searched for in the home 
  864. (current) directory first, and if not found, will then be searched for in 
  865. directories specified by any "+L" (library path) options active. This would 
  866. facilitate keeping all your "include" (.inc) files such as shapes.inc, 
  867. colors.inc, and textures.inc in an "include" subdirectory, and giving an "+L" 
  868. option on the command line to where your library of include files are. 
  869.  
  870.  
  871. ΓòÉΓòÉΓòÉ 5.1.3. 4.1.3  Placing The Camera ΓòÉΓòÉΓòÉ
  872.  
  873. The camera declaration describes where and how the camera sees the scene. It 
  874. gives X, Y, Z coordinates to indicate the position of the camera and what part 
  875. of the scene it is pointing at. You describe X, Y, Z coordinates using a 3-part 
  876. "vector".  A vector is specified by putting 3 numeric values between a pair of 
  877. angle brackets and separating the values with commas. 
  878.  
  879. Briefly, "location <0, 2, -3>" places the camera up two units and back three 
  880. units from the center of the ray tracing universe which is at <0, 0, 0>. 
  881. Remember that by default +Z is into the screen and -Z is back out of the 
  882. screen. 
  883.  
  884. Also "look_at <0, 1, 2>" rotates the camera to point at X, Y, Z coordinates <0, 
  885. 1, 2>.  A point 5 units in front of and 1 unit lower than the camera. The 
  886. look_at point should be the center of attention of your image. 
  887.  
  888.  
  889. ΓòÉΓòÉΓòÉ 5.1.4. 4.1.4  Describing An Object ΓòÉΓòÉΓòÉ
  890.  
  891. Now that the camera is set up to record the scene, let's place a red sphere 
  892. into the scene.  Type the following into your scene file: 
  893.  
  894.         sphere {
  895.           <0, 1, 2>, 2
  896.           texture {
  897.           pigment {color Yellow}  // Yellow is pre-defined in COLORS.INC
  898.           }
  899.         }
  900.  
  901. The first vector specifies center of the sphere.  In this example the X 
  902. coordinate is zero so it is centered left and right.  It is also at Y=1 or 1 
  903. unit up from the origin. The Z coordinate is 2 which is 5 units in front of the 
  904. camera at Z=-3. After the center vector is a comma followed by the radius which 
  905. in this case is 2 units. Since the radius is 1/2 the width of a sphere, the 
  906. sphere is 4 units wide. 
  907.  
  908.  
  909. ΓòÉΓòÉΓòÉ 5.1.5. 4.1.5  Adding Texture To An Object ΓòÉΓòÉΓòÉ
  910.  
  911. Now that we've defined the location and size of the sphere, we need to describe 
  912. the appearance of the surface.  The texture {...} block specifies these 
  913. parameters.  Texture blocks describe the color, bumpiness and finish properties 
  914. of an object.  In this example we will specify the color only. This is the 
  915. minimum we must do.  All other texture options except color will use the 
  916. default values. 
  917.  
  918. The color you define is the way you want it to look if fully illuminated. If 
  919. you were painting a picture of a sphere you would use dark shades of a color to 
  920. indicate the shadowed side and bright shades on the illuminated side.  However 
  921. ray tracing takes care of that for you.  You pick the basic color inherent in 
  922. the object and POV-Ray brightens or darkens it depending on the lighting in the 
  923. scene.  Because we are defining the basic color the object actually IS rather 
  924. than how it LOOKS the parameter is called "pigment". 
  925.  
  926. Many types of color patterns are available for use in a pigment {...} 
  927. statement.  The keyword "color" specifies that the whole object is to be one 
  928. solid color rather than some pattern of colors.  The word "Yellow" is a color 
  929. identifier which was previously defined in the standard include file 
  930. "colors.inc". 
  931.  
  932. If no standard color is available for your needs, you may define your own color 
  933. by using the color keyword followed by "red", "green" and "blue" keywords 
  934. specifying the amount of red, green and blue to be mixed.  For example a nice 
  935. shade of pink can be specified by: 
  936.  
  937.         color red 1.0 green 0.8 blue 0.8
  938.  
  939. The values after each keyword should be in the range 0.0 to 1.0.  Any of the 
  940. three components not specified will default to 0.  A shortcut notation may also 
  941. be used.  The following produces the same shade of pink: 
  942.  
  943.         color rgb <1.0, 0.8, 0.8>
  944.  
  945. Colors are explained in more detail later. 
  946.  
  947.  
  948. ΓòÉΓòÉΓòÉ 5.1.6. 4.1.6  Defining A Light Source ΓòÉΓòÉΓòÉ
  949.  
  950. One more detail is needed for our scene.  We need a light source. Until you 
  951. create one, there is no light in this virtual world.  Add the following text to 
  952. your scene file: 
  953.  
  954.         light_source { <2, 4, -3> color White}
  955.  
  956. The vector specifies the location of the light as 2 units to our right, 4 units 
  957. above the origin and 3 units back from the origin. The light_source is 
  958. invisible, it only casts light, so no texture is needed. 
  959.  
  960. That's it!  Close the file and render a small picture of it using this command: 
  961.  
  962.         POVRAY +W160 +H120 +P +X +D0 -V -Ipicture1.pov
  963.  
  964. If your computer does not use the command line, see the executable docs for the 
  965. correct command to render a scene. 
  966.  
  967. You may set any other command line options you like, also. The scene is output 
  968. to the image file DATA.TGA (or some suffix other than TGA if your computer uses 
  969. a different file format). You can convert DATA.TGA to a GIF image using the 
  970. commands listed in the docs included with your executable. 
  971.  
  972.  
  973. ΓòÉΓòÉΓòÉ 5.2. 4.2  More Texture Options ΓòÉΓòÉΓòÉ
  974.  
  975. You've now rendered your first picture but it is somewhat boring.  Let's add 
  976. some fancy features to the texture. 
  977.  
  978.  
  979. ΓòÉΓòÉΓòÉ 5.2.1. 4.2.1  Surface Finishes ΓòÉΓòÉΓòÉ
  980.  
  981. One of the main features of a ray tracer is its ability to do interesting 
  982. things with surface finishes such as highlights and reflection.  Let's add a 
  983. nice little phong highlight (shiny spot) to the sphere. To do this you need a 
  984. "finish" parameter. Change the definition of the sphere to this: 
  985.  
  986.         sphere {
  987.           <0, 1, 2>, 2
  988.           texture {
  989.             pigment {color Yellow}  // Yellow is pre-defined in COLORS.INC
  990.             finish {phong 1}
  991.           }
  992.         }
  993.  
  994. Now render this the same way you did before. The phong keyword adds a highlight 
  995. the same color of the light shining on the object. It adds a lot of credibility 
  996. to the picture and makes the object look smooth and shiny. Lower values of 
  997. phong will make the highlight less bright. Phong can be between 0 and 1. 
  998.  
  999.  
  1000. ΓòÉΓòÉΓòÉ 5.2.2. 4.2.2  Adding Bumpiness ΓòÉΓòÉΓòÉ
  1001.  
  1002. The highlight you've added illustrates how much of our perception depends on 
  1003. the reflective properties of an object.  Ray tracing can exploit this by 
  1004. playing tricks on our perception to make us see complex details that aren't 
  1005. really there. 
  1006.  
  1007. Suppose you wanted a very bumpy surface on the object.  It would be very 
  1008. difficult to mathematically model lots of bumps.  We can however simulate the 
  1009. way bumps look by altering the way light reflects off of the surface. 
  1010. Reflection calculations depend on a vector called a "surface normal" vector. 
  1011. This is a vector which points away from the surface and is perpendicular to it. 
  1012. By artificially modifying (or perturbing) this normal vector you can simulate 
  1013. bumps.  Change the scene to read as follows and render it: 
  1014.  
  1015.         sphere {
  1016.           <0, 1, 2>, 2
  1017.           texture {
  1018.             pigment {color Yellow}
  1019.             normal {bumps 0.4   scale 0.2}
  1020.             finish {phong 1}
  1021.           }
  1022.         }
  1023.  
  1024. This tells POV-Ray to use a bump pattern to modify the surface normal.  The 
  1025. value 0.4 controls the apparent depth of the bumps.  Usually the bumps are 
  1026. about 1 unit wide which doesn't work very well with a sphere of radius 2. The 
  1027. scale makes the bumps 1/5th as wide but does not affect their depth. 
  1028.  
  1029.  
  1030. ΓòÉΓòÉΓòÉ 5.2.3. 4.2.3  Creating Color Patterns ΓòÉΓòÉΓòÉ
  1031.  
  1032. You can do more than assign a solid color to an object.  You can create complex 
  1033. patterns in the pigment block.  Consider this example: 
  1034.  
  1035.         sphere {
  1036.           <0, 1, 2>, 2
  1037.           texture {
  1038.             pigment {
  1039.               wood
  1040.               color_map {
  1041.                 [0.0 color DarkTan]
  1042.                 [0.9 color DarkBrown]
  1043.                 [1.0 color VeryDarkBrown]
  1044.               }
  1045.               turbulence 0.05
  1046.               scale <0.2, 0.3, 1>
  1047.             }
  1048.             finish {phong 1}
  1049.          }
  1050.         }
  1051.  
  1052. The keyword "wood" specifies a pigment pattern of concentric rings like rings 
  1053. in wood.  The color_map specifies that the color of the wood should blend from 
  1054. DarkTan to DarkBrown over the first 90% of the vein and from DarkBrown to 
  1055. VeryDarkBrown over the remaining 10%.  The turbulence slightly stirs up the 
  1056. pattern so the veins aren't perfect circles and the scale factor adjusts the 
  1057. size of the pattern. 
  1058.  
  1059. The most of the patterns are set up by default to give you one "feature" across 
  1060. a sphere of radius 1.0. A "feature" is very roughly defined as a color 
  1061. transition. For example, a wood texture would have one band on a sphere of 
  1062. radius 1.0. In this example we scale the pattern using the "scale" keyword 
  1063. followed by a vector.  In this case we scaled 0.2 in the x direction, 0.3 in 
  1064. the y direction an the z direction is scaled by 1, which leaves it unchanged. 
  1065. Scale values larger than 1 will stretch an element. Scale values smaller than 
  1066. one will squish an element. And scale value 1 will leave an element unchanged. 
  1067.  
  1068.  
  1069. ΓòÉΓòÉΓòÉ 5.2.4. 4.2.4  Pre-Defined Textures ΓòÉΓòÉΓòÉ
  1070.  
  1071. POV-Ray has some very sophisticated textures pre-defined in the standard 
  1072. include files "textures.inc" and "stones.inc".  Some are entire textures with 
  1073. pigment, normal and/or finish parameters already defined.  Some are just 
  1074. pigments or just finishes.  Change the definition of our sphere to the 
  1075. following and then re-render it: 
  1076.  
  1077.         sphere {
  1078.           <0, 1, 2>, 2
  1079.           texture {
  1080.             pigment {
  1081.               DMFWood4    // Pre-defined from textures.inc
  1082.               scale 4     // Scale by the same amount in all
  1083.                           // directions
  1084.             }
  1085.             finish {Shiny}      // This finish defined in textures.inc
  1086.           }
  1087.         }
  1088.  
  1089. The pigment identifier DMFWood4 has already been scaled down quite small when 
  1090. it was defined.  For this example we want to scale the pattern larger. Because 
  1091. we want to scale it uniformly we can put a single value after the scale keyword 
  1092. rather than a vector of x,y,z scale factors. 
  1093.  
  1094. Look through the file TEXTURES.INC to see what pigments and finishes are 
  1095. defined and try them out. Just insert the name of the new pigment where 
  1096. DMFWood1 is now or try a different finish in place of Shiny and re-render your 
  1097. file. 
  1098.  
  1099. Here is an example of using a complete texture identifier rather than just the 
  1100. pieces. 
  1101.  
  1102.         sphere {
  1103.           <0, 1, 2>, 2
  1104.           texture { PinkAlabaster }
  1105.         }
  1106.  
  1107.  
  1108. ΓòÉΓòÉΓòÉ 5.3. 4.3  More Shapes ΓòÉΓòÉΓòÉ
  1109.  
  1110. So far, we've just used the sphere shape. There are many other types of shapes 
  1111. that can be rendered by POV-Ray.  First let's make some room in the image by 
  1112. changing the sphere from a radius of 2 to a radius of 1 like this: 
  1113.  
  1114.         sphere {
  1115.           <0, 1, 2>, 1
  1116.           texture { ... and so on.
  1117.  
  1118.  
  1119. ΓòÉΓòÉΓòÉ 5.3.1. 4.3.1  Plane Object ΓòÉΓòÉΓòÉ
  1120.  
  1121. Let's try out a computer graphics standard - "The Checkered Floor."  Add the 
  1122. following object to your .pov file: 
  1123.  
  1124.         plane {
  1125.           <0, 1, 0>, 0
  1126.           pigment {
  1127.             checker
  1128.               color Red
  1129.               color Blue
  1130.           }
  1131.         }
  1132.  
  1133. The object defined here is an infinite plane. The vector <0, 1, 0> is the 
  1134. surface normal of the plane (i.e., if you were standing on the surface, the 
  1135. normal points straight up.) The number afterward is the distance that the plane 
  1136. is displaced along the normal from the origin - in this case, the floor is 
  1137. placed at Y=0 so that the sphere at Y=1, radius= 1, is resting on it. 
  1138.  
  1139. Notice that there is no "texture{...}" statement.  There really is an implied 
  1140. texture there.  You might find that continually typing statements that are 
  1141. nested like "texture {pigment {...}}" can get to be a tiresome so POV-Ray lets 
  1142. you leave out the "texture{...}" under many circumstances.  In general you only 
  1143. need the texture block surrounding a texture identifier (like the PinkAlabaster 
  1144. example above), or when creating layered textures (which are covered later). 
  1145.  
  1146. This pigment uses the checker color pattern and specifies that the two colors 
  1147. red and blue should be used. 
  1148.  
  1149. Because the vectors <1,0,0>, <0,1,0> and <0,0,1> are used frequently, POV- Ray 
  1150. has 3 built-in vector identifiers "x", "y", and "z" respectively that can be 
  1151. used as shorthand.  Thus the plane could be defined as: 
  1152.  
  1153.         plane {
  1154.           y,0
  1155.           pigment {... etc.
  1156.  
  1157. Note that you do not use angle brackets around vector identifiers. 
  1158.  
  1159. Looking at the floor, you'll notice that the ball casts a shadow on the floor. 
  1160. Shadows are calculated very accurately by the ray tracer and creates precise, 
  1161. sharp shadows.  In the real world, penumbral or "soft" shadows are often seen. 
  1162. Later you'll learn how to use extended light sources to soften the shadows. 
  1163.  
  1164.  
  1165. ΓòÉΓòÉΓòÉ 5.3.2. 4.3.2  Box Object ΓòÉΓòÉΓòÉ
  1166.  
  1167. There are several other simple shapes available in POV-Ray.  The most common 
  1168. are the box, cylinder and cone.  Try these examples in place of the sphere: 
  1169.  
  1170.         box {
  1171.           <-1,0  ,-1>,     // Near lower left corner
  1172.           < 1,0.5, 3>      // Far upper right corner
  1173.            pigment {
  1174.            DMFWood4      // Pre-defined from textures.inc
  1175.            scale 4       // Scale by the same amount in all
  1176.                          // directions
  1177.         }
  1178.            rotate y*20     // Equivalent to "rotate <0,20,0>"
  1179.         }
  1180.  
  1181. In this example you can see that a box is defined by specifying the 3D 
  1182. coordinates of opposite corners.  The first vector must be the minimum x,y,z 
  1183. coordinates and the 2nd vector must be the maximum x,y,z values.  Box objects 
  1184. can only be defined parallel to the axes.  You can later rotate them to any 
  1185. angle. Note that you can perform simple math on values and vectors. In the 
  1186. rotate parameter we multiplied the vector identifier "y" by 20.  This is the 
  1187. same as "<0,1,0>*20" or "<0,20,0>". 
  1188.  
  1189.  
  1190. ΓòÉΓòÉΓòÉ 5.3.3. 4.3.3  Cone Object ΓòÉΓòÉΓòÉ
  1191.  
  1192. Here's another example: 
  1193.  
  1194.         cone {
  1195.           <0,1,0>,0.3    // Center and radius of one end
  1196.           <1,2,3>,1.0    // Center and radius of other end
  1197.           pigment {DMFWood4  scale 4 }
  1198.           finish {Shiny}
  1199.         }
  1200.  
  1201. The cone shape is defined by the center and radius of each end.  In this 
  1202. example one end is at location <0,1,0> and has radius of 0.3 while the other 
  1203. end is centered at <1,2,3> with radius 1.  If you want the cone to come to a 
  1204. sharp point then use a 0 radius.  The solid end caps are parallel to each other 
  1205. and perpendicular to the cone axis.  If you want a hollow cone with no end caps 
  1206. then add the keyword "open" after the 2nd radius like this: 
  1207.  
  1208.         cone {
  1209.           <0,1,0>,0.3    // Center and radius of one end
  1210.           <1,2,3>,1.0    // Center and radius of other end
  1211.           open           // Removes end caps
  1212.           pigment {DMFWood4  scale 4 }
  1213.           finish {Shiny}
  1214.         }
  1215.  
  1216.  
  1217. ΓòÉΓòÉΓòÉ 5.3.4. 4.3.4  Cylinder Object ΓòÉΓòÉΓòÉ
  1218.  
  1219. You may also define a cylinder like this: 
  1220.  
  1221.         cylinder {
  1222.           <0,1,0>,       // Center of one end
  1223.           <1,2,3>,       // Center of other end
  1224.           0.5            // Radius
  1225.           open           // Remove end caps
  1226.           pigment {DMFWood4  scale 4 }
  1227.           finish {Shiny}
  1228.         }
  1229.  
  1230. Finally the standard include file "shapes.inc" contains some pre-defined shapes 
  1231. that are about the size of a sphere with a radius of one unit.  You can invoke 
  1232. them like this: 
  1233.  
  1234.         object {
  1235.           UnitBox
  1236.           pigment {DMFWood4  scale 4 }
  1237.           finish {Shiny}
  1238.           scale 0.75
  1239.           rotate <-20,25,0>
  1240.           translate y
  1241.         }
  1242.  
  1243. That's the end of our brief tutorial.  We've only scratched the surface. The 
  1244. rest of this document provides a reference to all of POV-Ray's features. 
  1245.  
  1246.  
  1247. ΓòÉΓòÉΓòÉ 6. 5.0  Scene Description Language Reference ΓòÉΓòÉΓòÉ
  1248.  
  1249. The Scene Description Language allows the user to describe the world in a 
  1250. readable and convenient way.  Files are created in plain ASCII text using an 
  1251. editor of your choice.  POV-Ray reads the file, processes it by creating an 
  1252. internal model of the scene and the renders the scene. 
  1253.  
  1254.  
  1255. ΓòÉΓòÉΓòÉ 6.1. 5.1  Language Basics ΓòÉΓòÉΓòÉ
  1256.  
  1257. The POV-Ray language consists of identifiers, reserved keywords, floating point 
  1258. literals, string literals, special symbols and comments.  The text of a POV-Ray 
  1259. scene file is free format.  You may put statements on separate lines or on the 
  1260. same line as you desire.  You may add blank lines, spaces or indentations as 
  1261. long as you do not split any keywords or identifiers. 
  1262.  
  1263.  
  1264. ΓòÉΓòÉΓòÉ 6.1.1. 5.1.1  Identifiers And Keywords ΓòÉΓòÉΓòÉ
  1265.  
  1266. POV-Ray allows you to define identifiers for later use in the file.  An 
  1267. identifier may be 1 to 40 characters long.  It may consist of upper or lower 
  1268. case letters, the digits 0 through 9 or an underscore character.  The first 
  1269. character must be an alphabetic character.  The declaration of identifiers is 
  1270. covered later. 
  1271.  
  1272. POV-Ray has a number of reserved words which are used in the language.  All 
  1273. reserved words are fully lower case.  Therefore it is recommended that your 
  1274. identifiers contain at least 1 upper case character so it is sure to avoid 
  1275. conflict with reserved words. 
  1276.  
  1277. The following keywords are reserved in POV-Ray: 
  1278.  
  1279. adaptive               height_field           rgbf
  1280. agate                  hexagon                right
  1281. agate_turb             iff                    ripples
  1282. all                    image_map              rotate
  1283. alpha                  include                roughness
  1284. ambient                interpolate            scale
  1285. area_light             intersection           sky
  1286. background             inverse                smooth
  1287. bicubic_patch          ior                    smooth_triangle
  1288. blob                   jitter                 specular
  1289. blue                   lambda                 sphere
  1290. bounded_by             leopard                spotlight
  1291. box                    light_source           spotted
  1292. bozo                   location               sturm
  1293. brilliance             looks_like             texture
  1294. bumps                  look_at                tga
  1295. bump_map               mandel                 threshold
  1296. bump_size              map_type               tightness
  1297. camera                 marble                 tile2
  1298. checker                material_map           tiles
  1299. clipped_by             max_intersections      torus
  1300. clock                  max_trace_level        translate
  1301. color                  merge                  triangle
  1302. color_map              metallic               turbulence
  1303. colour                 normal                 type
  1304. colour_map             no_shadow              union
  1305. component              object                 up
  1306. composite              octaves                use_color
  1307. cone                   omega                  use_colour
  1308. crand                  once                   use_index
  1309. cubic                  onion                  u_steps
  1310. cylinder               open                   version
  1311. declare                phase                  v_steps
  1312. default                phong                  water_level
  1313. dents                  phong_size             waves
  1314. difference             pigment                wood
  1315. diffuse                plane                  wrinkles
  1316. direction              point_at               x
  1317. disc                   poly                   y
  1318. distance               pot                    z
  1319. dump                   quadric
  1320. falloff                quartic
  1321. filter                 quick_color
  1322. finish                 quick_colour
  1323. flatness               radial
  1324. fog                    radius
  1325. frequency              raw
  1326. gif                    red
  1327. gradient               reflection
  1328. granite                refraction
  1329. green                  rgb
  1330.  
  1331.  
  1332. ΓòÉΓòÉΓòÉ 6.1.2. 5.1.2  Comments ΓòÉΓòÉΓòÉ
  1333.  
  1334. Comments are text in the scene file included to make the scene file easier to 
  1335. read or understand. They are ignored by the ray tracer and are there for humans 
  1336. to read.  There are two types of comments in POV-Ray. 
  1337.  
  1338. Two slashes are used for single line comments.  Anything on a line after a 
  1339. double slash // is ignored by the ray tracer.  For example: 
  1340.  
  1341.         // This line is ignored
  1342.  
  1343. You can have scene file information on the line in front of the comment, as in: 
  1344.  
  1345.         object { FooBar }  // this is an object
  1346.  
  1347. The other type of comment is used for multiple lines.  This type of comment 
  1348. starts with /* and ends with */ everything in-between is ignored.  For example: 
  1349.  
  1350.         /* These lines
  1351.            Are ignored
  1352.            By the
  1353.            Raytracer */
  1354.  
  1355. This can be useful if you want to temporarily remove elements from a scene 
  1356. file.  /*...*/ comments can "comment out" lines containing the other // 
  1357. comments, and thus can be used to temporarily or permanently comment out parts 
  1358. of a scene.  /*..*/ comments can be nested, the following is legal: 
  1359.  
  1360.         /* This is a comment
  1361.         // This too
  1362.         /* This also */
  1363.         */
  1364.  
  1365. Use comments liberally and generously. Well used, they really improve the 
  1366. readability of scene files. 
  1367.  
  1368.  
  1369. ΓòÉΓòÉΓòÉ 6.1.3. 5.1.3  Include Files ΓòÉΓòÉΓòÉ
  1370.  
  1371. The language allows include files to be specified by placing the line: 
  1372.  
  1373.         #include "filename.inc"
  1374.  
  1375. at any point in the input file. The filename must be enclosed in double quotes 
  1376. and may be up to 40 characters long (or your computer's limit), including the 
  1377. two double-quote (") characters. 
  1378.  
  1379. The include file is read in as if it were inserted at that point in the file. 
  1380. Using include is the same as actually cutting and pasting the entire contents 
  1381. of this file into your scene. 
  1382.  
  1383. Include files may be nested. You may have at most 10 nested include files. 
  1384. There is no limit on un-nested include files. 
  1385.  
  1386. Generally, include files have data for scenes, but are not scenes in 
  1387. themselves. By convention scene files end in .pov and include files end with 
  1388. .inc. 
  1389.  
  1390.  
  1391. ΓòÉΓòÉΓòÉ 6.1.4. 5.1.4  Float Expressions ΓòÉΓòÉΓòÉ
  1392.  
  1393. Many parts of the POV-Ray language require you to specify one or more floating 
  1394. point numbers.  A floating point number is a number with a decimal point. 
  1395. Float literals are represented by an optional sign (-), some digits, an 
  1396. optional decimal point, and more digits.  If the number is an integer you may 
  1397. omit the decimal point and trailing zero.  If it is all fractional you may omit 
  1398. the leading zero.  POV-Ray supports scientific notation for very large or very 
  1399. small numbers.  The following are all valid float literals: 
  1400.  
  1401.         1.0   -2.0  -4    34    3.4e6       2e-5        .3    0.6
  1402.  
  1403. Float identifiers may be declared and used anywhere a float can be used. See 
  1404. section 5.1.7 on declaring identifiers. 
  1405.  
  1406. Complex float expressions can be created using + - * / ( ) with float literals 
  1407. or identifiers.  Assuming the identifiers have been previously declared as 
  1408. floats, the following are valid float expressions: 
  1409.  
  1410.         1+2+3       2*5         1/3         Row*3       Col*5
  1411.  
  1412.         (Offset-5)/2            This/That+Other*Thing
  1413.  
  1414. Expressions are evaluated left to right with innermost parenthesis evaluated 
  1415. first, then unary + or -, then multiply or divide, then add or subtract. 
  1416.  
  1417. There are two built-in float identifiers.  The identifier "version" is the 
  1418. current setting of the version compatibility switch (See +MV under command- 
  1419. line switches).  This allows you to save and restore the previous version 
  1420. switch.  For example suppose MYSTUFF.INC is in version 1.0 format.  At the top 
  1421. of the file you could put: 
  1422.  
  1423.         #declare Temp_Vers = version    // Save previous value
  1424.         #version 1.0                    // Change to 1.0 mode
  1425.  
  1426.         ...   // Version 1.0 stuff goes here...
  1427.  
  1428.         #version Temp_Vers              // Restore previous version
  1429.  
  1430. The other float identifier is "clock".  Its value is set by the +K command- 
  1431. line switch. (See +K under command-line switches).  This allows you to do 
  1432. limited animation control.  For example you could move an object using: 
  1433.  
  1434.         translate <0.1*clock,0,0>
  1435.  
  1436. and render successive frames with +K1, +K2, +K3 etc.  In each frame the object 
  1437. would move 1/10th of a unit. 
  1438.  
  1439.  
  1440. ΓòÉΓòÉΓòÉ 6.1.5. 5.1.5  Vector Expressions ΓòÉΓòÉΓòÉ
  1441.  
  1442. POV-Ray operates in a 3D x,y,z coordinate system.  Often you will need to 
  1443. specify x, y and z values.  A "vector" is a set of three float values used for 
  1444. such specification.  Vectors consist of three float expressions that are 
  1445. bracketed by angle brackets < and >.  The three terms are separated by commas. 
  1446. For example: 
  1447.  
  1448.         < 1.0, 3.2, -5.4578 >
  1449.  
  1450. The commas are necessary to keep the program from thinking that the 2nd term is 
  1451. "3.2-5.4578" and that there is no 3rd term.  If you see an error message "Float 
  1452. expected but '>' found instead" it probably means two floats were combined 
  1453. because a comma was missing. 
  1454.  
  1455. The three values correspond to the x, y and z directions respectively. For 
  1456. example, the vector <1,2,3> means the point that's 1 unit to the right, 2 units 
  1457. up, and 3 units in front the center of the "universe" at <0,0,0>. Vectors are 
  1458. not always points, though. They can also refer to an amount to size, move, or 
  1459. rotate a scene element. 
  1460.  
  1461. Vectors may also be combined in expressions the same as float values.  For 
  1462. example <1,2,3>+<4,5,6> evaluates as <5,7,9>.  Subtraction, multiplication and 
  1463. division are also performed on a term-by-term basis.  You may also combine 
  1464. floats with vectors.  For example 5*<1,2,3> evaluates as <5,10,15>. 
  1465.  
  1466. Sometimes POV-Ray requires you to specify floats and vectors side-by-side. Thus 
  1467. commas are required separators whenever an ambiguity might arise.  For example 
  1468. <1,2,3>-4 evaluates as <-3,-2,-1> but <1,2,3>,-4 is a vector followed by a 
  1469. float. 
  1470.  
  1471. Vector identifiers may be declared and used anywhere a vector can be used. See 
  1472. section 5.1.7 on declaring identifiers. 
  1473.  
  1474. Because vectors almost always refer to the x, y and z coordinates, POV-Ray has 
  1475. three built-in vector identifiers "x "y" and "z".  Like all POV-Ray keywords 
  1476. they must be lower case.  The vector identifier x is equivalent to the vector 
  1477. <1,0,0>.  Similarly y is <0,1,0> and z is <0,0,1>. 
  1478.  
  1479. Thus an expression like 5*x evaluates to 5*<1,0,0> or <5,0,0>.  The use of 
  1480. these identifiers can make the scene file easier to read. 
  1481.  
  1482.  
  1483. ΓòÉΓòÉΓòÉ 6.1.6. 5.1.6  Transformations ΓòÉΓòÉΓòÉ
  1484.  
  1485. Vectors are used not only as a notation for a point in space but are used in 
  1486. the transformations scale, rotate, and translate. Scale sizes a texture or 
  1487. object. Translate moves a texture or object. And rotate turns a texture or 
  1488. object. 
  1489.  
  1490.  
  1491. ΓòÉΓòÉΓòÉ 6.1.6.1. 5.1.6.1  Translate ΓòÉΓòÉΓòÉ
  1492.  
  1493. An object or texture pattern may be moved by adding a "translate" parameter. 
  1494. It consists of the keyword "translate" followed by a vector. The terms of the 
  1495. vector specify the number of units to move in each of the x, y, and z 
  1496. directions.  Translate moves the element relative to it's current position. For 
  1497. example, 
  1498.  
  1499.         sphere { <10, 10, 10>, 1
  1500.         pigment { Green }
  1501.         translate <-5, 2, 1>
  1502.         }
  1503.  
  1504. Will move the sphere from <10, 10, 10> to <5, 12, 11>.  It does not move it to 
  1505. absolute location <5, 2, 1>. Translating by zero will leave the element 
  1506. unchanged on that axis. For example, 
  1507.  
  1508.         sphere { <10, 10, 10>, 1
  1509.         pigment { Green }
  1510.         translate <0, 0, 0>
  1511.         }
  1512.  
  1513. Will not move the sphere at all. 
  1514.  
  1515.  
  1516. ΓòÉΓòÉΓòÉ 6.1.6.2. 5.1.6.2  Scale ΓòÉΓòÉΓòÉ
  1517.  
  1518. You may change the size of an object or texture pattern by adding a "scale" 
  1519. parameter.  It consists of the keyword "scale" followed by a vector or a single 
  1520. float value.  If a vector is used, terms of the vector specify the amount of 
  1521. scaling in each of the x, y, and z directions.  If a float value is used, the 
  1522. item is uniformly scaled by the same amount in all directions. 
  1523.  
  1524. Scale, is used to "stretch" or "squish" an element. Values larger than 1 
  1525. stretch the element on that axis. Values smaller than one are used to squish 
  1526. the element on that axis. Scale is relative to the current element size. If the 
  1527. element has been previously re-sized using scale, then scale will size relative 
  1528. to the new size. Multiple scale values may used. 
  1529.  
  1530.  
  1531. ΓòÉΓòÉΓòÉ 6.1.6.3. 5.1.6.3  Rotate ΓòÉΓòÉΓòÉ
  1532.  
  1533. You may change the orientation of an object or texture pattern by adding a 
  1534. "rotate" parameter.  It consists of the keyword "rotate" followed by a vector. 
  1535. The three terms of the vector specify the number of degrees to rotate about 
  1536. each of the x, y, and z axes. 
  1537.  
  1538. Note that the order of the rotations does matter.  Rotations occur about the x 
  1539. axis first, then the y axis, then the z axis.  If you are not sure if this is 
  1540. what you want then you should use multiple rotation statements to get a correct 
  1541. rotation. You should only rotate on one axis at a time. As in, 
  1542.  
  1543.         rotate <0, 30, 0>  // 30 degrees around Y axis then,
  1544.         rotate <-20, 0, 0> // -20 degrees around X axis then,
  1545.         rotate <0, 0, 10>  // 10 degrees around Z axis.
  1546.  
  1547. Rotation is always performed relative to the axis.  Thus if an object is some 
  1548. distance from the axis of rotation, its will not only rotate but it will 
  1549. "orbit" about the axis as though it was swinging around on an invisible string. 
  1550.  
  1551. To work out the rotation directions, you must perform the famous "Computer 
  1552. Graphics Aerobics" exercise. Hold up your left hand. Point your thumb in the 
  1553. positive direction of the axis of rotation. Your fingers will curl in the 
  1554. positive direction of rotation. Similarly if you point your thumb in the 
  1555. negative direction of the axis your fingers will curl in the negative direction 
  1556. of rotation.  This is the famous "left-hand coordinate system". 
  1557.  
  1558.                ^
  1559.              +Y|   +Z/ _
  1560.                |    /_| |_  _
  1561.                |   _| | | |/ \
  1562.                |  | | | | |  |
  1563.                | /| | | | |  V
  1564.      -X        |/ | | | | |    +X
  1565.     <----------+--|-|-|-|-|------>
  1566.               /|  |       \____
  1567.              / |  |         ___|
  1568.             /  |  \        /
  1569.            /   |   |      /
  1570.         -Z/  -Y|
  1571.          /     |
  1572.  
  1573. In this illustration, the left hand is curling around the X axis. The thumb 
  1574. points in the positive X direction and the fingers curl over in the positive 
  1575. rotation direction. 
  1576.  
  1577. If you want to use a right hand system, as some CAD systems such as AutoCAD do, 
  1578. the "right" vector in the camera specification needs to be changed. See the 
  1579. detailed description of the camera.  In a right handed system you use your 
  1580. right hand for the "Aerobics". 
  1581.  
  1582.  
  1583. ΓòÉΓòÉΓòÉ 6.1.6.4. 5.1.6.4  Transforming Textures and Objects ΓòÉΓòÉΓòÉ
  1584.  
  1585. When an object is transformed, all textures attached to the object AT THAT TIME 
  1586. are transformed as well. This means that if you have a translate, rotate, or 
  1587. scale in an object BEFORE a texture, the texture will not be transformed. If 
  1588. the scale, translate, or rotate is AFTER the texture then the texture will be 
  1589. transformed with the object.  If the transformation is INSIDE the "texture { }" 
  1590. statement then ONLY THE TEXTURE is affected.  The shape remains the same.  For 
  1591. example: 
  1592.  
  1593.         sphere { <0, 0, 0>, 1
  1594.           texture { White_Marble }  // texture identifier from TEXTURES.INC
  1595.           scale 3                   // This scale affects both the
  1596.                                     // shape and texture
  1597.          }
  1598.  
  1599.         sphere { <0, 0, 0>, 1
  1600.           scale 3             // This scale affects the shape only
  1601.           texture { White_Marble }
  1602.          }
  1603.  
  1604.         sphere { <0, 0, 0>, 1
  1605.            texture {
  1606.            White_Marble
  1607.            scale 3           // This scale affects the texture only
  1608.          }
  1609.         }
  1610.  
  1611. Transformations may also be independently applied to pigment patterns and 
  1612. surface normal (bump) patterns. Note scaling a normal pattern affects only the 
  1613. width and spacing.  It does not affect the height or depth. For example: 
  1614.  
  1615.         box { <0, 0, 0>, <1, 1, 1>
  1616.           texture {
  1617.           pigment {
  1618.              checker color Red color White
  1619.              scale 0.25  // This affects only the color pattern
  1620.              }
  1621.         normal {
  1622.            bumps 0.3   // This specifies apparent height of bumps
  1623.            scale 0.2   // Scales diameter and space between bumps but not
  1624.                        //  not the height. Has no effect on color pattern.
  1625.            }
  1626.            rotate y*45   // This affects the entire texture but not
  1627.          }               //  the object.
  1628.        }
  1629.  
  1630.  
  1631. ΓòÉΓòÉΓòÉ 6.1.6.5. 5.1.6.5  Transformation Order ΓòÉΓòÉΓòÉ
  1632.  
  1633. Because rotations are always relative to the axis and scaling is relative to 
  1634. the origin, you will generally want to create an object at the origin and scale 
  1635. and rotate it first.  Then you may translate it into its proper position.  It 
  1636. is a common mistake to carefully position an object and then to decide to 
  1637. rotate it.  Because a rotation of an object causes it to orbit the axis, the 
  1638. position of the object may change so much that it orbits out of the field of 
  1639. view of the camera! 
  1640.  
  1641. Similarly scaling after translation also moves an object unexpectedly. If you 
  1642. scale after you translate, the scale will multiply the translate amount. For 
  1643. example: 
  1644.  
  1645.         translate <5, 6, 7>
  1646.         scale 4
  1647.  
  1648. Will translate to 20, 24, 28 instead of 5, 6, 7. Be careful when transforming 
  1649. to get the order correct for your purposes. 
  1650.  
  1651.  
  1652. ΓòÉΓòÉΓòÉ 6.1.7. 5.1.7  Declare ΓòÉΓòÉΓòÉ
  1653.  
  1654. The parameters used to describe the scene elements can be tedious to use at 
  1655. times. Some parameters are often repeated and it seems wasteful to have to type 
  1656. them over and over again. To make this task easier, the program allows users to 
  1657. create identifiers as synonyms for a pre-defined set of parameters and use them 
  1658. anywhere the parameters would normally be used. For example, the color white is 
  1659. defined in the POV-Ray language as: 
  1660.  
  1661.         color red 1 green 1 blue 1
  1662.  
  1663. This can be pre-defined in the scene as: 
  1664.  
  1665.         #declare White = color red 1 green 1 blue 1
  1666. and then substituted for the full description in the scene file, for example: 
  1667.  
  1668.         sphere {
  1669.           <0, 0, 0>, 1
  1670.           pigment { color red 1 green 1 blue 1 }
  1671.         }
  1672.  
  1673. becomes: 
  1674.  
  1675.         #declare White = color red 1 green 1 blue 1
  1676.  
  1677.         sphere {
  1678.           <0, 0, 0>, 1
  1679.           pigment { color White }
  1680.         }
  1681.  
  1682. This is much easier to type and to read. The pre-defined element may be used 
  1683. many times in a scene. 
  1684.  
  1685. You use the keyword "declare" to pre-define a scene element and give it a 
  1686. one-word identifier. This pre-defined scene element is not used in the scene 
  1687. until you invoke its identifier. Textures, objects, colors, numbers and more 
  1688. can be predefined. 
  1689.  
  1690. In most cases when you invoke an identifier you simply use the form 
  1691. "keyword{identifier}" where the keyword used is the type of statement that was 
  1692. declared. For example: 
  1693.  
  1694.         #declare Shiny = finish {phong 0.8 phong_size 50 reflection 0.2}
  1695.  
  1696.         sphere {
  1697.           <0, 0, 0>, 1
  1698.           pigment { color White }
  1699.           finish { Shiny }
  1700.         }
  1701.  
  1702. The identifier "Shiny" was declared as a "finish" and is invoked by placing it 
  1703. inside a "finish { }" statement. 
  1704.  
  1705. One exception is object identifiers.  If you declare any object of any kind 
  1706. such as sphere, box, union, intersection etc. you should invoke it by placing 
  1707. it in an "object { }" statement.  Thus you might have: 
  1708.  
  1709.         #declare Thing = intersection {...}
  1710.  
  1711.            object {Thing}  // not "intersection{Thing}"
  1712.  
  1713. Pre-defined elements may be modified when they are used, for example: 
  1714.  
  1715.         #declare Mickey = // Pre-define a union object called Mickey
  1716.            union {
  1717.              sphere { < 0, 0, 0>, 2 }
  1718.              sphere { <-2, 2, 0>, 1 }
  1719.              sphere { < 2, 2, 0>, 1 }
  1720.         }
  1721.  
  1722.   // Use Mickey
  1723.            object{        // Note use of "object", not "union" keyword
  1724.            Mickey
  1725.            scale 3
  1726.            rotate y*20
  1727.            translate <0, 8, 10>
  1728.            pigment {color red 1}
  1729.            finish {phong .7}
  1730.         }
  1731.  
  1732. This scene will only have one "Mickey", the Mickey that is described doesn't 
  1733. appear in the scene. Notice that Mickey is scaled, rotated, translated, and a 
  1734. texture is added to it. The Mickey identifier could be used many times in a 
  1735. scene file, and each could have a different size, position, orientation, and 
  1736. texture. 
  1737.  
  1738. Declare is especially powerful when used to create a complex object. Each part 
  1739. of the object is defined separately using declare. These parts can be tested, 
  1740. rotated, sized, positioned, and textured separately then combined in one shape 
  1741. or object for the final sizing, positioning, etc. For example, you could define 
  1742. all the parts of a car like this: 
  1743.  
  1744.         #declare Wheel = object {...}
  1745.         #declare Seat = object {...}
  1746.         #declare Body = object {...}
  1747.         #declare Engine = object {...}
  1748.         #declare Steering_Wheel = object {...}
  1749.  
  1750.         #declare Car =
  1751.            union {
  1752.              object { Wheel translate < 1, 1, 2>}
  1753.              object { Wheel translate <-1, 1, 2>}
  1754.              object { Wheel translate < 1, 1,-2>}
  1755.              object { Wheel translate <-1, 1,-2>}
  1756.              object { Seat translate < .5, 1.4, 1>}
  1757.              object { Seat translate <-.5, 1.4, 1>}
  1758.              object { Steering_Wheel translate <-.5, 1.6, 1.3>}
  1759.              object { Body texture { Brushed_Steel } }
  1760.              object { Engine translate <0, 1.5, 1.5>
  1761.         }
  1762.  
  1763. and then it like this: 
  1764.  
  1765.         // Here is a car
  1766.         object {
  1767.           Car
  1768.           translate <4, 0, 23>
  1769.         }
  1770.  
  1771. Notice that the Wheel and Seat are used more than once. A declared element can 
  1772. be used as many times as you need. Declared elements may be placed in "include" 
  1773. files so they can be used with more than one scene. 
  1774.  
  1775. There are several files included with POV-Ray that use declare to pre- define 
  1776. many shapes, colors, and textures. See the archive INCLUDE for more info. 
  1777.  
  1778. NOTE: Declare is not the same as the C language's define. Declare creates an 
  1779. internal object of the type specified that POV-Ray can copy for later use.  The 
  1780. "define" used in C creates a text substitution macro. 
  1781.  
  1782. Here's a list of what can be declared, how to declare the element, and how to 
  1783. use the declaration. See the reference section for element syntax. 
  1784.  
  1785. Objects: (Any type may be declared, sphere, box, height_field, blob, etc.) 
  1786.  
  1787.         #declare Tree = union {...}
  1788.         #declare Ball = sphere {...}
  1789.         #declare Crate= box {...}
  1790.  
  1791.            object {
  1792.              Tree
  1793.              (OBJECT_MODIFIERS...)
  1794.         }
  1795.  
  1796.            object {
  1797.              Ball
  1798.              (OBJECT_MODIFIERS...)
  1799.        }
  1800.  
  1801.           object {
  1802.             Crate
  1803.             (OBJECT_MODIFIERS...)
  1804.        }
  1805.  
  1806. Textures: 
  1807.  
  1808.         #declare Fred = texture {...}
  1809.  
  1810.         sphere { <0, 0, 0>, 1
  1811.           texture {
  1812.             Fred
  1813.             (texture_modifiers)
  1814.          }
  1815.         }
  1816.  
  1817. Layered textures: 
  1818.  
  1819.         #declare Fred =
  1820.            texture {...}
  1821.            texture {...}
  1822.            texture {...} (etc.)
  1823.  
  1824.         sphere { <0, 0, 0>, 1
  1825.           texture {
  1826.           Fred
  1827.           (texture_modifiers)
  1828.          }
  1829.         }
  1830.  
  1831. Pigment: 
  1832.  
  1833.         #declare Fred = pigment {checker color Red color White}
  1834.  
  1835.         sphere { <0, 0, 0>, 1
  1836.           pigment {
  1837.             Fred
  1838.             (pigment_modifiers)
  1839.          }
  1840.         }
  1841.  
  1842. Normal: 
  1843.  
  1844.         #declare Fred = normal {bumps 0.5}
  1845.  
  1846.            sphere { <0, 0, 0>, 1
  1847.              pigment {White}
  1848.              normal {
  1849.              Fred
  1850.              (normal_modifiers)
  1851.          }
  1852.         }
  1853.  
  1854. Finish: 
  1855.  
  1856.         #declare Fred = finish {phong 0.7 reflection 0.2}
  1857.  
  1858.             sphere { <0, 0, 0>, 1
  1859.               pigment {White}
  1860.               finish {
  1861.               Fred
  1862.              (finish_items)
  1863.          }
  1864.         }
  1865.  
  1866. Colors: 
  1867.  
  1868.         #declare Fred = color red 1 green 1 blue 1
  1869.  
  1870.            sphere { <0, 0, 0>, 1
  1871.              pigment { color Fred }
  1872.         }
  1873.  
  1874. Color_map: 
  1875.  
  1876.         #declare Rainbow =
  1877.            color_map {
  1878.            [0.0 color Cyan]
  1879.            [1/3 color Yellow]
  1880.            [2/3 color Magenta]
  1881.            [1.0 color Cyan]
  1882.         }
  1883.  
  1884.            sphere { <0, 0, 0>, 1
  1885.              pigment { radial color_map{Rainbow} rotate -90*x}
  1886.         }
  1887.  
  1888. Float Values: 
  1889.  
  1890.         #declare Fred  = 3.45
  1891.         #declare Fred2 = .02
  1892.         #declare Fred3 = .5
  1893.  
  1894.        // Use the numeric value identifier
  1895.        // anywhere a number would go
  1896.            sphere { <-Fred, 2, Fred>, Fred
  1897.              pigment { color red 1 }
  1898.              finish { phong Fred3 }
  1899.         }
  1900.  
  1901. Camera: 
  1902.  
  1903.         #declare Fred = camera {..}
  1904.  
  1905.            camera { Fred }
  1906.  
  1907. Vectors: 
  1908.  
  1909.         #declare Fred = <9, 3, 2>
  1910.         #declare Fred2 = <4, 1, 4>
  1911.  
  1912.            sphere { Fred, 1  // Note do not put < > brackets
  1913.              scale Fred2     // around vector identifiers
  1914.         }
  1915.  
  1916.  
  1917. ΓòÉΓòÉΓòÉ 6.2. 5.2  Objects ΓòÉΓòÉΓòÉ
  1918.  
  1919. Objects are the building blocks of your scene.  There are 20 different types of 
  1920. objects supported by POV-Ray.  Seven of them are finite solid primitives, 4 are 
  1921. finite patch primitives, 5 are infinite solid polynomial primitives, 3 are 
  1922. types of Constructive Solid Geometry types and one is a specialized object that 
  1923. is a light source. 
  1924.  
  1925. The basic syntax of an object is a keyword describing its type, some floats, 
  1926. vectors or other parameters which further define its location and/or shape and 
  1927. some optional object modifiers such as texture, pigment, normal, finish, 
  1928. bounding, clipping or transformations. 
  1929.  
  1930. The texture describes what the object looks like, ie. its material. Textures 
  1931. are combinations of pigments, normals and finishes.  Pigment is the color or 
  1932. pattern of colors inherent in the material.  Normal is a method of simulating 
  1933. various patterns of bumps, dents, ripples or waves by modifying the surface 
  1934. normal vector.  Finish describes the reflective and refractive properties of a 
  1935. material. 
  1936.  
  1937. Bounding shapes are finite, invisible shapes which wrap around complex, slow 
  1938. rendering shapes in order to speed up rendering time.  Clipping shapes are used 
  1939. to cut away parts of shapes to expose a hollow interior. Transformations tell 
  1940. the ray tracer how to move, size or rotate the shape and/or the texture in the 
  1941. scene. 
  1942.  
  1943.  
  1944. ΓòÉΓòÉΓòÉ 6.2.1. 5.2.1  Solid Finite Primitives ΓòÉΓòÉΓòÉ
  1945.  
  1946. There are 7 different solid finite primitive shapes: blob, box, cone, cylinder, 
  1947. height_field, sphere, and torus. These have a well-defined "inside" and can be 
  1948. used in Constructive Solid Geometry. Because these types are finite, POV-Ray 
  1949. can use automatic bounding on them to speed up rendering time. 
  1950.  
  1951.  
  1952. ΓòÉΓòÉΓòÉ 6.2.1.1. 5.2.1.1  Spheres ΓòÉΓòÉΓòÉ
  1953.  
  1954. Since spheres are so common in ray traced graphics, POV-Ray has a highly 
  1955. optimized sphere primitive which renders much more quickly than the 
  1956. corresponding polynomial quadric shape. The syntax is: 
  1957.  
  1958.         sphere { <CENTER>, RADIUS }
  1959.  
  1960. Where <CENTER> is a vector specifying the x,y,z coordinates of the center of 
  1961. the sphere and RADIUS is a float value specifying the radius.  You can also add 
  1962. translations, rotations, and scaling to the sphere. For example, the following 
  1963. two objects are identical: 
  1964.  
  1965.         sphere { <0, 25, 0>, 10
  1966.           pigment {Blue}
  1967.         }
  1968.  
  1969.         sphere { <0, 0, 0>, 1.0
  1970.           pigment {Blue}
  1971.           scale 10
  1972.           translate y*25
  1973.         }
  1974.  
  1975. Note that Spheres may be scaled unevenly giving an ellipsoid shape. 
  1976.  
  1977. Because spheres are highly optimized they make good bounding shapes. Because 
  1978. they are finite they respond to automatic bounding. As with all shapes, they 
  1979. can be translated, rotated and scaled. 
  1980.  
  1981.  
  1982. ΓòÉΓòÉΓòÉ 6.2.1.2. 5.2.1.2  Boxes ΓòÉΓòÉΓòÉ
  1983.  
  1984. A simple box can be defined by listing two corners of the box like this: 
  1985.  
  1986.         box { <CORNER1>, <CORNER2> }
  1987.  
  1988. Where <CORNER1> and <CORNER2> are vectors defining the x,y,z coordinates of 
  1989. opposite corners of the box.  For example: 
  1990.  
  1991.         box { <0, 0, 0>, <1, 1, 1> }
  1992.  
  1993. Note that all boxes are defined with their faces parallel to the coordinate 
  1994. axes.  They may later be rotated to any orientation using a rotate parameter. 
  1995.  
  1996. Each element of CORNER1 should always be less than the corresponding element in 
  1997. CORNER2. If any elements of CORNER1 are larger than CORNER2, the box will not 
  1998. appear in the scene. 
  1999.  
  2000. Boxes are calculated efficiently and make good bounding shapes. Because they 
  2001. are finite they respond to automatic bounding. As with all shapes, they can be 
  2002. translated, rotated and scaled. 
  2003.  
  2004.  
  2005. ΓòÉΓòÉΓòÉ 6.2.1.3. 5.2.1.3  Cylinders ΓòÉΓòÉΓòÉ
  2006.  
  2007. A finite length cylinder with parallel end caps may be defined by. 
  2008.  
  2009.         cylinder { <END1>, <END2>, RADIUS }
  2010.  
  2011. Where <END1> and <END2> are vectors defining the x,y,z coordinates of the 
  2012. center of each end of the cylinder and RADIUS is a float value for the radius. 
  2013. For example: 
  2014.  
  2015.         cylinder { <0,0,0>, <3,0,0>, 2}
  2016.  
  2017. is a cylinder 3 units long lying along the x axis from the origin to x=3 with a 
  2018. radius of 2. 
  2019.  
  2020. Normally the ends of a cylinder are closed by flat planes which are parallel to 
  2021. each other and perpendicular to the length of the cylinder. Adding the optional 
  2022. keyword "open" after the radius will remove the end caps and results in a 
  2023. hollow tube. 
  2024.  
  2025. Because they are finite they respond to automatic bounding. As with all shapes, 
  2026. they can be translated, rotated and scaled. 
  2027.  
  2028.  
  2029. ΓòÉΓòÉΓòÉ 6.2.1.4. 5.2.1.4  Cones ΓòÉΓòÉΓòÉ
  2030.  
  2031. A finite length cone or a frustum (a cone with the point cut off) may be 
  2032. defined by. 
  2033.  
  2034.         cone { <END1>, RADIUS1, <END2>, RADIUS2 }
  2035.  
  2036. Where <END1> and <END2> are vectors defining the x,y,z coordinates of the 
  2037. center of each end of the cone and RADIUS1 and RADIUS2 are float values for the 
  2038. radius of those ends.  For example: 
  2039.  
  2040.         cone { <0,0,0>,2 <0,3,0>, 0}
  2041.  
  2042. is a cone 3 units tall pointing up the y axis from the origin to y=3.  The base 
  2043. has a radius of 2.  The other end has a radius of 0 which means it comes to a 
  2044. sharp point.  If neither radius is zero then the results look like a tapered 
  2045. cylinder or a cone with the point cut off. 
  2046.  
  2047. Like a cylinder, normally the ends of a cone are closed by flat planes which 
  2048. are parallel to each other and perpendicular to the length of the cone.  Adding 
  2049. the optional keyword "open" after RADIUS2 will remove the end caps and results 
  2050. in a tapered hollow tube like a megaphone or funnel. 
  2051.  
  2052. Because they are finite they respond to automatic bounding. As with all shapes, 
  2053. they can be translated, rotated and scaled. 
  2054.  
  2055.  
  2056. ΓòÉΓòÉΓòÉ 6.2.1.5. 5.2.1.5  Torus ΓòÉΓòÉΓòÉ
  2057.  
  2058. A torus is a 4th order quartic polynomial shape that looks like a donut or 
  2059. inner tube.  Because this shape is so useful and quartics are difficult to 
  2060. define, POV-Ray lets you take a short-cut and define a torus by: 
  2061.  
  2062.         torus { MAJOR, MINOR }
  2063.  
  2064. where MAJOR is a float value giving the major radius and MINOR is a float 
  2065. specifying the minor radius.  The major radius extends from the center of the 
  2066. hole to the mid-line of the rim while the minor radius is the radius of the 
  2067. cross-section of the rim.  The torus is centered at the origin and lies in the 
  2068. X-Z plane with the Y-axis sticking through the hole. 
  2069.  
  2070.            ----------- - - - - - - - ----------              +Y
  2071.           /          \              /          \              |
  2072.          /            \            /            \             |
  2073.         |              |          |       |<-B-->|       -X---|---+X
  2074.          \            /            \            /             |
  2075.           \__________/_ _ _ _ _ _ _ \__________/              |
  2076.                             |<-----A----->|                  -Y
  2077.  
  2078.         A = Major Radius
  2079.         B = Minor Radius
  2080.  
  2081. Internally the torus is computed the same as any other quartic or 4th order 
  2082. polynomial however a torus defined this way will respond to automatic bounding 
  2083. while a quartic must be manually bound if at all.  As with all shapes, a torus 
  2084. can be translated, rotated and scaled.  Calculations for all higher order 
  2085. polynomials must be very accurate.  If this shape renders improperly you may 
  2086. add the keyword "sturm" after the MINOR value to use POV-Ray's 
  2087. slower-yet-more-accurate Sturmian root solver. 
  2088.  
  2089.  
  2090. ΓòÉΓòÉΓòÉ 6.2.1.6. 5.2.1.6  Blob ΓòÉΓòÉΓòÉ
  2091.  
  2092. Blobs are an interesting shape type. Their components are "flexible" spheres 
  2093. that attract or repel each other creating a "blobby" organic looking shape. The 
  2094. spheres' surfaces actually stretch out smoothly and connect, as if coated in 
  2095. silly putty (honey? glop?) and pulled apart. 
  2096.  
  2097. Picture each blob component as a point floating in space.  Each point has a 
  2098. field around it that starts very strong at the center point and drops off to 
  2099. zero at some radius. POV-Ray adds together the field strength of each component 
  2100. and looks for the places that the strength of the field is exactly the same as 
  2101. the "threshold" value that was specified.  Points with a total field strength 
  2102. greater than the threshold are considered inside the blob.  Those less than the 
  2103. threshold are outside.  Points equal to the threshold are on the surface of the 
  2104. blob. 
  2105.  
  2106. A blob is defined as follows: 
  2107.  
  2108.         blob {
  2109.               threshold THRESHOLD_VALUE
  2110.               component STRENGTH, RADIUS, <CENTER>
  2111.               component STRENGTH, RADIUS, <CENTER>  // Repeat for any number
  2112.               component STRENGTH, RADIUS, <CENTER>  //  of components
  2113.         }
  2114.  
  2115. The keyword "threshold" is followed by a float THRESHOLD_VALUE.  Each component 
  2116. begins with the keyword "component".  STRENGTH is a float value specifying the 
  2117. field strength at its center.  The strength may be positive or negative. A 
  2118. positive value will make that component attract other components. Negative 
  2119. strength will make that component repel other components. Components in 
  2120. different, separate blob shapes do not affect each other.  The strength tapers 
  2121. off to zero at the value specified by the float RADIUS.  The vector <CENTER> 
  2122. specifies the x,y,z coordinates of the component. For example: 
  2123.  
  2124.         blob {
  2125.               threshold 0.6
  2126.               component 1.0, 1.0, <.75, 0, 0>
  2127.               component 1.0, 1.0, <-.375, .64952, 0>
  2128.               component 1.0, 1.0, <-.375, -.64952, 0>
  2129.               scale 2
  2130.         }
  2131.  
  2132. If you have a single blob component then the surface you see will look just 
  2133. like a sphere, with the radius of the surface being somewhere inside the 
  2134. "radius" value you specified for the component. The exact radius of this 
  2135. sphere-like surface can be determined from the blob equation listed below (you 
  2136. will probably never need to know this, blobs are more for visual appeal than 
  2137. for exact modeling). 
  2138.  
  2139. If you have a number of blob components, then their fields add together at 
  2140. every point in space - this means that if the blob components are close 
  2141. together the resulting surface will smoothly flow around the components. 
  2142.  
  2143. The various numbers that you specify in the blob declaration interact in 
  2144. several ways.  The meaning of each can be roughly stated as: 
  2145.  
  2146. THRESHOLD: 
  2147.  
  2148.    This is the total density value that POV-Ray is looking for. By following 
  2149. the ray out into space and looking at how each blob component affects the ray, 
  2150. POV-Ray will find the points in space where the density is equal to the 
  2151. "threshold" value. 
  2152.  
  2153.  1. "threshold" must be greater than 0. POV-Ray only looks for positive 
  2154.     densities. 
  2155.  
  2156.  2. If "threshold" is greater than the strength of a component, then the 
  2157.     component will disappear. 
  2158.  
  2159.  3. As "threshold" gets larger the surface you see gets closer to the centers 
  2160.     of the components. 
  2161.  
  2162.  4. As "threshold" gets smaller, the surface you see gets closer to the spheres 
  2163.     at a distance of "radius" from the centers of the components. 
  2164.  
  2165. STRENGTH: 
  2166.  
  2167.    Each component has a strength value - this defines the density of the 
  2168. component at the center of the component. Changing this value will usually have 
  2169. only a subtle effect. 
  2170.  
  2171.  1. "strength" may be positive or negative. Zero is a bad value, as the net 
  2172.     result is that no density was added - you might just as well have not used 
  2173.     this component. 
  2174.  
  2175.  2. If "strength" is positive, then POV-Ray will add its density to the space 
  2176.     around the center of the component. If this adds enough density to be 
  2177.     greater than "threshold you will see a surface. 
  2178.  
  2179.  3. If "strength" is negative, then POV-Ray will subtract its density from the 
  2180.     space around the center of the component. This will only do something if 
  2181.     there happen to be positive components nearby. What happens is that the 
  2182.     surface around any nearby positive components will be dented away from the 
  2183.     center of the negative component. 
  2184.  
  2185. RADIUS: 
  2186.  
  2187.    Each component has a radius of influence. The component can only affect 
  2188. space within "radius" of its center. This means that if all of the components 
  2189. are farther than "radius" from each other, you will only see a bunch of 
  2190. spheres.  If a component is within the radius of another component, then the 
  2191. two components start to affect each other. At first there is only a small bulge 
  2192. outwards on each of the two components, as they get closer they bulge more and 
  2193. more until they attach along a smooth neck. If the components are very close 
  2194. (i.e. their centers are on top of each other), then you will only see a sphere 
  2195. (this is just like having a component of more strength. bigger than the size of 
  2196. each of the component radii) 
  2197.  
  2198.  1. "radius" must be bigger than 0. 
  2199.  
  2200.  2. As "radius" increases the apparent size of the component will increase. 
  2201.  
  2202. CENTER: 
  2203.  
  2204.    This is simply a point in space.  It defines the center of a blob component. 
  2205. By changing the x/y/z values of the center you move the component around. 
  2206.  
  2207. THE FORMULA 
  2208.  
  2209.    For the more mathematically minded, here's the formula used internally by 
  2210. POV-Ray to create blobs. You don't need to understand this to use blobs. 
  2211.  
  2212. The formula used for a single blob component is: 
  2213.  
  2214.         density = strength * (1 - radius^2)^2
  2215.  
  2216. This formula has the nice property that it is exactly equal to strength" at the 
  2217. center of the component and drops off to exactly 0 at a distance of "radius" 
  2218. from the center of the component. The density formula for more than one blob 
  2219. component is just the sum of the individual component densities: 
  2220.  
  2221.         density = density1 + density2 + ...
  2222.  
  2223. Blobs can be used in CSG shapes and they can be scaled, rotated and translated. 
  2224. Because they are finite they respond to automatic bounding. The calculations 
  2225. for blobs must be very accurate.  If this shape renders improperly you may add 
  2226. the keyword "sturm" after the last component to use POV-Ray's 
  2227. slower-yet-more-accurate Sturmian root solver. 
  2228.  
  2229.  
  2230. ΓòÉΓòÉΓòÉ 6.2.1.7. 5.2.1.7  Height Fields ΓòÉΓòÉΓòÉ
  2231.  
  2232. Height fields are fast, efficient objects that are generally used to create 
  2233. mountains or other raised surfaces out of hundreds of triangles in a mesh. 
  2234.  
  2235. A height field is essentially a 1 unit wide by 1 unit long box with a 
  2236. mountainous surface on top.  The height of the mountain at each point is taken 
  2237. from the color number (palette index) of the pixels in a graphic image file. 
  2238.  
  2239.                     ________  <---- image index 255
  2240.                   /        /|
  2241.             +1y  ---------- |
  2242.                  |        | |
  2243.                  |        | |+1z <- Image upper-right
  2244.                  |        | /
  2245.             0,0,0---------- +1x
  2246.                  ^
  2247.                  |____ Image lower-left
  2248.  
  2249. NOTE: Image resolution is irrelevant to the scale of the heightfield. 
  2250.  
  2251. The mesh of triangles corresponds directly to the pixels in the image file. In 
  2252. fact, there are two small triangles for every pixel in the image file. The Y 
  2253. (height) component of the triangles is determined by the palette index number 
  2254. stored at each location in the image file. The higher the number, the higher 
  2255. the triangle. The maximum height of an un-scaled height field is 1 unit. 
  2256.  
  2257. The higher the resolution of the image file used to create the height field, 
  2258. the smoother the height field will look. A 640 X 480 GIF will create a smoother 
  2259. height field than a 320 x 200 GIF.  The size/resolution of the image does not 
  2260. affect the size of the height field. The un-scaled height field size will 
  2261. always be 1x1. Higher resolution image files will create smaller triangles, not 
  2262. larger height fields. 
  2263.  
  2264. There are three types files which can define a height field as follows: 
  2265.  
  2266.         height_field { gif "filename.gif" }
  2267.         height_field { tga "filename.tga" }
  2268.         height_field { pot "filename.pot" }
  2269.  
  2270. The image file used to create a height field can be a GIF, TGA or POT format 
  2271. file. The GIF format is the only one that can be created using a standard paint 
  2272. program. 
  2273.  
  2274. In a GIF file, the color number is the palette index at a given point. Use a 
  2275. paint program to look at the palette of a GIF image. The first color is palette 
  2276. index zero, the second is index 1, the third is index 2, and so on. The last 
  2277. palette entry is index 255. Portions of the image that use low palette entries 
  2278. will be lower on the height field.  Portions of the image that use higher 
  2279. palette entries will be higher on the height field. For example, an image that 
  2280. was completely made up of entry 0 would be a flat 1x1 square. An image that was 
  2281. completely made up of entry 255 would be a 1x1x1 cube. 
  2282.  
  2283. The maximum number of colors in a GIF are 256, so a GIF height field can have 
  2284. any number of triangles, but they will only 256 different height values. 
  2285.  
  2286. The color of the palette entry does not affect the height of the pixel. Color 
  2287. entry 0 could be red, blue, black, or orange, but the height of any pixel that 
  2288. uses color entry 0 will always be 0. Color entry 255 could be indigo, hot pink, 
  2289. white, or sky blue, but the height of any pixel that uses color entry 255 will 
  2290. always be 1. 
  2291.  
  2292. You can create height field GIF images with a paint program or a fractal 
  2293. program like "Fractint".  If you have access to an IBM-PC, you can get Fractint 
  2294. from most of the same sources as POV-Ray. 
  2295.  
  2296. A POT file is essentially a GIF file with a 16 bit palette. The maximum number 
  2297. of colors in a POT file is greater than 32,000. This means a POT height field 
  2298. can have over 32,000 possible height values. This makes it possible to have 
  2299. much smoother height fields. Note that the maximum height of the field is still 
  2300. 1 even though more intermediate values are possible. 
  2301.  
  2302. At the time of this writing, the only program that created POT files was a 
  2303. freeware IBM-PC program called Fractint. POT files generated with this fractal 
  2304. program create fantastic landscapes. If you have access to an IBM- PC, you can 
  2305. get Fractint from most of the same sources as POV-Ray. 
  2306.  
  2307. The TGA file format may be used as a storage device for 16 bit numbers rather 
  2308. than an image file. The TGA format uses the red and green bytes of each pixel 
  2309. to store the high and low bytes of a height value. TGA files are as smooth as 
  2310. POT files, but they must be generated with special custom-made programs. 
  2311. Currently, this format is of most use to programmers, though you may see TGA 
  2312. height field generator programs arriving soon.  There is example C source code 
  2313. included with the POV-Ray source archive to create a TGA file for use with a 
  2314. height field. 
  2315.  
  2316. It is nearly impossible to take advantage of the 16 bits of resolution offered 
  2317. by the use of tga files in height fields when the tga file is created in a 
  2318. paint program.  A gif file is a better choice for paint created height fields 
  2319. in 8 bits.  Also see Appendix B.5 for a tip on creating tga files for height 
  2320. fields. 
  2321.  
  2322. An optional "water_level" parameter may be added after the file name.  It 
  2323. consists of the keyword "water_level" followed by a float value tells the 
  2324. program not to look for the height field below that value. Default value is 0, 
  2325. and legal values are between 0 and 1. For example, "water_level .5" tells 
  2326. POV-Ray to only render the top half of the height field. The other half is 
  2327. "below the water" and couldn't be seen anyway. This term comes from the popular 
  2328. use of height fields to render landscapes. A height field would be used to 
  2329. create islands and another shape would be used to simulate water around the 
  2330. islands. A large portion of the height field would be obscured by the "water" 
  2331. so the "water_level" parameter was introduced to allow the ray-tracer to ignore 
  2332. the unseen parts of the height field. Water_level is also used to "cut away" 
  2333. unwanted lower values in a height field. For example, if you have an image of a 
  2334. fractal on a solid colored background, where the background color is palette 
  2335. entry 0, you can remove the background in the height field by specifying, 
  2336. "water_level .001" 
  2337.  
  2338. Normally height fields have a rough, jagged look because they are made of lots 
  2339. of flat triangles.  Adding the keyword "smooth" causes POV-Ray to modify the 
  2340. surface normal vectors of the triangles in such a way that the lighting and 
  2341. shading of the triangles will give a smooth look.  This may allow you to use a 
  2342. lower resolution file for your height field than would otherwise be needed. 
  2343.  
  2344. Height fields can be used in CSG shapes and they can be scaled, rotated and 
  2345. translated. Because they are finite they respond to automatic bounding. 
  2346.  
  2347. Here are a notes and helpful hints on height fields from their creator, Doug 
  2348. Muir: 
  2349.  
  2350. The height field is mapped to the x-z plane, with its lower left corner sitting 
  2351. at the origin. It extends to 1 in the positive x direction and to 1 in the 
  2352. positive z direction. It is maximum 1 unit high in the y direction. You can 
  2353. translate it, scale it, and rotate it to your heart's content. 
  2354.  
  2355. When deciding on what water_level to use, remember, this applies to the un- 
  2356. transformed height field. If you are a Fractint user, the water_level should be 
  2357. used just like the water_level parameter for 3d projections in Fractint. 
  2358.  
  2359. Here's a detailed explanation of how the ray-tracer creates the height field. 
  2360. You can skip this if you aren't interested in the technical side of 
  2361. ray-tracing. This information is not needed to create or use height fields. 
  2362.  
  2363. To find an intersection with the height field, the ray tracer first checks to 
  2364. see if the ray intersects the box which surrounds the height field. Before any 
  2365. transformations, this box's two opposite vertexes are at (0, water_level, 0) 
  2366. and (1, 1, 1). If the box is intersected, the ray tracer figures out where, and 
  2367. then follows the line from where the ray enters the box to where it leaves the 
  2368. box, checking each pixel it crosses for an intersection. 
  2369.  
  2370. It checks the pixel by dividing it up into two triangles. The height vertex of 
  2371. the triangle is determined by the color index at the corresponding position in 
  2372. the GIF, POT, or TGA file. 
  2373.  
  2374. If your file has a uses the color map randomly, your height field is going to 
  2375. look pretty chaotic, with tall, thin spikes shooting up all over the place. Not 
  2376. every GIF will make a good height field. 
  2377.  
  2378. If you want to get an idea of what your height field will look like, I 
  2379. recommend using the IBM-PC program Fractint's 3d projection features to do a 
  2380. sort of preview. If it doesn't look good there, the ray tracer isn't going to 
  2381. fix it. For those of you who can't use Fractint, convert the image palette to a 
  2382. gray scale from black at entry 0 to white at entry 255 with smooth steps of 
  2383. gray in-between. The dark parts will lower than the brighter parts, so you can 
  2384. get a feel for how the image will look as a height field. 
  2385.  
  2386.  
  2387. ΓòÉΓòÉΓòÉ 6.2.2. 5.2.2  Finite Patch Primitives ΓòÉΓòÉΓòÉ
  2388.  
  2389. There are 4 totally thin, finite objects which have NO well-defined inside. 
  2390. They may be combined in CSG union but cannot be use in other types of CSG. They 
  2391. are bicubic_patch, disc, smooth_triangle and triangle. Because these types are 
  2392. finite, POV-Ray can use automatic bounding on them to speed up rendering time. 
  2393.  
  2394.  
  2395. ΓòÉΓòÉΓòÉ 6.2.2.1. 5.2.2.1  Triangle and Smooth_triangle ΓòÉΓòÉΓòÉ
  2396.  
  2397. The triangle primitive is available in order to make more complex objects than 
  2398. the built-in shapes will permit.  Triangles are usually not created by hand, 
  2399. but are converted from other files or generated by utilities. 
  2400.  
  2401. A triangle is defined by: 
  2402.  
  2403.         triangle { <CORNER1>, <CORNER2>, <CORNER3> }
  2404.  
  2405. where <CORNERn> is a vector defining the x,y,z coordinates of each corner of 
  2406. the triangle. 
  2407.  
  2408. Because triangles are perfectly flat surfaces it would require extremely large 
  2409. numbers of very small triangles to approximate a smooth, curved surface. 
  2410. However much of our perception of smooth surfaces is dependent upon the way 
  2411. light and shading is done.  By artificially modifying the surface normals we 
  2412. can simulate as smooth surface and hide the sharp-edged seams between 
  2413. individual triangles. 
  2414.  
  2415. The smooth_triangle primitive is used for just such purposes.  The 
  2416. smooth_triangles use a formula called Phong normal interpolation to calculate 
  2417. the surface normal for any point on the triangle based on normal vectors which 
  2418. you define for the three corners.  This makes the triangle appear to be a 
  2419. smooth curved surface. A smooth_triangle is defined by: 
  2420.  
  2421.         smooth_triangle {
  2422.                 <CORNER1>, <NORMAL1>,
  2423.                 <CORNER2>, <NORMAL2>,
  2424.                 <CORNER3>, <NORMAL3>
  2425.         }
  2426.  
  2427. where the corners are defined as in regular triangles and <NORMALn> is a vector 
  2428. describing the direction of the surface normal at each corner. 
  2429.  
  2430. These normal vectors are prohibitively difficult to compute by hand. Therefore 
  2431. smooth_triangles are almost always generated by utility programs. To achieve 
  2432. smooth results, any triangles which share a common vertex should have the same 
  2433. normal vector at that vertex.  Generally the smoothed normal should be the 
  2434. average of all the actual normals of the triangles which share that point. 
  2435.  
  2436.  
  2437. ΓòÉΓòÉΓòÉ 6.2.2.2. 5.2.2.2  Bicubic_patch ΓòÉΓòÉΓòÉ
  2438.  
  2439. A bicubic patch is a 3D curved surface created from a mesh of triangles. 
  2440. POV-Ray supports a type of bicubic patch called a Bezier patch.  A bicubic 
  2441. patch is defined as follows: 
  2442.  
  2443.         bicubic_patch {
  2444.                  type PATCH_TYPE
  2445.                  flatness FLATNESS_VALUE
  2446.                  u_steps NUM_U_STEPS
  2447.                  v_steps NUM_V_STEPS
  2448.                  <CP1>,  <CP2>,   <CP3>,   <CP4>,
  2449.                  <CP5>,  <CP6>,   <CP7>,   <CP8>,
  2450.                  <CP9>,  <CP10>,  <CP11>,  <CP12>,
  2451.                  <CP13>, <CP14>,  <CP15>,  <CP16>
  2452.         }
  2453.  
  2454. The keyword "type" is followed by a float PATCH_TYPE which currently must be 
  2455. either 0 or 1.  For type 0 only the control points are retained within POV-Ray. 
  2456. This means that a minimal amount of memory is needed, but POV-Ray will need to 
  2457. perform many extra calculations when trying to render the patch.  Type 1 
  2458. preprocesses the patch into many subpatches.  This results in a significant 
  2459. speedup in rendering, at the cost of memory. 
  2460.  
  2461. These 4 parameters: type, flatness, u_steps & v_steps, may appear in any order. 
  2462. They are followed by 16 vectors that define the x,y,z coordinates of the 16 
  2463. control points which define the patch.  The patch touches the 4 corner points 
  2464. <CP1>, <CP4>, <CP13> and <CP16> while the other 12 points pull and stretch the 
  2465. patch into shape. 
  2466.  
  2467. The keywords "u_steps" and "v_steps" are each followed by float values which 
  2468. tell how many rows and columns of triangles are the minimum to use to create 
  2469. the surface.  The maximum number of individual pieces of the patch that are 
  2470. tested by POV-Ray can be calculated from the following: 
  2471.  
  2472.         sub-pieces = 2^u_steps * 2^v_steps
  2473.  
  2474. This means that you really should keep "u_steps" and "v_steps" under 4 or 5. 
  2475. Most patches look just fine with "u_steps 3" and "v_steps 3", which translates 
  2476. to 64 subpatches (128 smooth triangles). 
  2477.  
  2478. As POV-Ray processes the Bezier patch, it makes a test of the current piece of 
  2479. the patch to see if it is flat enough to just pretend it is a rectangle. The 
  2480. statement that controls this test is: "flatness xxx".  Typical flatness values 
  2481. range from 0 to 1 (the lower the slower). 
  2482.  
  2483. If the value for flatness is 0, then POV-Ray will always subdivide the patch to 
  2484. the extend specified by u_steps and v_steps.  If flatness is greater than 0, 
  2485. then every time the patch is split, POV-Ray will check to see if there is any 
  2486. need to split further. 
  2487.  
  2488. There are both advantages and disadvantages to using a non-zero flatness. The 
  2489. advantages include: 
  2490.  
  2491. o If the patch isn't very curved, then this will be detected and POV-Ray won't 
  2492.   waste a lot of time looking at the wrong pieces. 
  2493.  
  2494. o If the patch is only highly curved in a couple of places, POV-Ray will keep 
  2495.   subdividing there and concentrate it's efforts on the hard part. 
  2496.  
  2497. The biggest disadvantage is that if POV-Ray stops subdividing at a particular 
  2498. level on one part of the patch and at a different level on an adjacent part of 
  2499. the patch, there is the potential for "cracking".  This is typically visible as 
  2500. spots within the patch where you can see through.  How bad this appears depends 
  2501. very highly on the angle at which you are viewing the patch. 
  2502.  
  2503. Like triangles, the bicubic patch is not meant to be generated by hand. These 
  2504. shapes should be created by a special utility. You may be able to acquire 
  2505. utilities to generate these shapes from the same source from which you obtained 
  2506. POV-Ray. 
  2507.  
  2508. Example: 
  2509.  
  2510.         bicubic_patch {
  2511.                  type 1
  2512.                  flatness 0.01
  2513.                  u_steps 4
  2514.                  v_steps 4
  2515.                  <0, 0, 2>, <1, 0, 0>, <2, 0, 0>, <3, 0,-2>,
  2516.                  <0, 1  0>, <1, 1, 0>, <2, 1, 0>, <3, 1, 0>,
  2517.                  <0, 2, 0>, <1, 2, 0>, <2, 2, 0>, <3, 2, 0>,
  2518.                  <0, 3, 2>, <1, 3, 0>, <2, 3, 0>, <3, 3, -2>
  2519.         }
  2520.  
  2521. The triangles in a POV-Ray bicubic_patch are automatically smoothed using 
  2522. normal interpolation but it is up to the user (or the user's utility program) 
  2523. to create control points which smoothly stitch together groups of patches. 
  2524.  
  2525. As with the other shapes, bicubic_patch objects can be translated, rotated, and 
  2526. scaled.  Because they are finite they respond to automatic bounding. Since it's 
  2527. made from triangles, a bicubic_patch cannot be used in CSG intersection or 
  2528. difference types or inside a clipped_by modifier because triangles have no 
  2529. clear "inside". The CSG union type works acceptably. 
  2530.  
  2531.  
  2532. ΓòÉΓòÉΓòÉ 6.2.2.3. 5.2.2.3  Disc ΓòÉΓòÉΓòÉ
  2533.  
  2534. One other flat, finite object type is available with POV-Ray. Note that a disc 
  2535. is infinitely thin.  It has no thickness.  If you want a disc with true 
  2536. thickness you should use a very short cylinder. A disc shape may be defined by: 
  2537.  
  2538.         disc { <CENTER>, <NORMAL>, RADIUS }
  2539.  
  2540. or 
  2541.  
  2542.         disc { <CENTER>, <NORMAL>, RADIUS, HOLE_RADIUS }
  2543.  
  2544. The vector <CENTER> defines the x,y,z coordinates of the center of the disc. 
  2545. The <NORMAL> vector describes its orientation by describing its surface normal 
  2546. vector.  This is followed by a float specifying the RADIUS. This may be 
  2547. optionally followed by another float specifying the radius of a hole to be cut 
  2548. from the center of the disc. 
  2549.  
  2550. Example: 
  2551.  
  2552.         disc {
  2553.            <-2,-0.5, 0>,    //center location
  2554.            <0,  1,   0>,    //normal vector
  2555.            2                //radius
  2556.         pigment { color Cyan }
  2557.       }
  2558.  
  2559.         disc {
  2560.            <0, 1, 0>,       //center location
  2561.            <-1, 3, -2>,     //normal vector
  2562.            1.5,             //radius
  2563.            0.5              //hole radius (optional)
  2564.         pigment { color Yellow }
  2565.       }
  2566.  
  2567. As with the other shapes, discs can be translated, rotated, and scaled. Because 
  2568. they are finite they respond to automatic bounding.  Disc cannot be used in CSG 
  2569. intersection or difference types or inside a clipped_by modifier because it has 
  2570. no clear "inside". The CSG union type works acceptably. 
  2571.  
  2572.  
  2573. ΓòÉΓòÉΓòÉ 6.2.3. 5.2.3  Infinite Solid Primitives ΓòÉΓòÉΓòÉ
  2574.  
  2575. There are 5 polynomial primitive shapes that are possibly infinite and do not 
  2576. respond to automatic bounding.  They do have a well defined inside and may be 
  2577. used in CSG.  They are plane, cubic, poly, quadric, and quartic. 
  2578.  
  2579.  
  2580. ΓòÉΓòÉΓòÉ 6.2.3.1. 5.2.3.1  Plane ΓòÉΓòÉΓòÉ
  2581.  
  2582. The plane primitive is a fast, efficient way to define an infinite flat 
  2583. surface.  The plane is specified as follows: 
  2584.  
  2585.         plane { <NORMAL>, DISTANCE }
  2586.  
  2587. The <NORMAL> vector defines the surface normal of the plane.  A surface normal 
  2588. is a vector which points up from the surface at a 90 degree angle. This is 
  2589. followed by a float value that gives the distance along the normal that the 
  2590. plane is from the origin.  For example: 
  2591.  
  2592.         plane { <0,1,0>,4 }
  2593.  
  2594. This is a plane where "straight up" is defined in the positive y direction. The 
  2595. plane is 4 units in that direction away from the origin.  Because most planes 
  2596. are defined with surface normals in the direction of an axis, you will often 
  2597. see planes defined using the "x", "y", or "z" built-in vector identifiers.  The 
  2598. example above could be specified as: 
  2599.  
  2600.         plane { y,4 }
  2601.  
  2602. The plane extends infinitely in the x and z directions.  It effectively divides 
  2603. the world into two pieces.  By definition the normal vector points to the 
  2604. outside of the plane while any points away from the vector are defined as 
  2605. inside.  This inside/outside distinction is only important when using planes in 
  2606. CSG. 
  2607.  
  2608. As with the other shapes, planes can be translated, rotated, and scaled. 
  2609. Because they are infinite they do not respond to automatic bounding.  Plane can 
  2610. be used freely in CSG because it has a clear defined "inside". 
  2611.  
  2612. A plane is called a "polynomial" shape because it is defined by a first order 
  2613. polynomial equation.  Given a plane: 
  2614.  
  2615.         plane { <A, B, C>, D }
  2616.  
  2617. it can be represented by the formula: 
  2618.  
  2619.         A*x + B*y + C*z = D
  2620.  
  2621. Therefore our example "plane {y,4}" is actually the polynomial equation "y=4". 
  2622. You can think of this as a set of all x,y,z points where all have y values 
  2623. equal to 4, regardless of the x or z values. 
  2624.  
  2625. This equation is a "first order" polynomial because each term contains only 
  2626. single powers of x, y or z.  A second order equation has terms like x^2, y^2, 
  2627. z^2, xy, xz and yz.  Another name for a 2nd order equation is a quadric 
  2628. equation.  Third order polys are called cubics.  A 4th order equation is a 
  2629. quartic.  Such shapes are described in the sections below. 
  2630.  
  2631. 5.2.3.2 Quadric 
  2632.  
  2633. Quadric surfaces can produce shapes like ellipsoids, spheres, cones, cylinders, 
  2634. paraboloids (dish shapes), and hyperboloids (saddle or hourglass shapes). NOTE: 
  2635. Do not confuse "quaDRic" with "quaRTic".  A quadric is a 2nd order polynomial 
  2636. while a quartic is 4th order. 
  2637.  
  2638. A quadric is defined in POV-Ray by: 
  2639.  
  2640.         quadric { <A,B,C>, <D,E,F>, <G,H,I>, J }
  2641.  
  2642. where A through J are float expressions. 
  2643.  
  2644. This defines a surface of x,y,z points which satisfy the equation: 
  2645.  
  2646.         A x^2   + B y^2   + C z^2
  2647.       + D xy    + E xz    + F yz
  2648.       + G x     + H y     + I z    + J = 0
  2649.  
  2650. Different values of A,B,C,...J will give different shapes. So, if you take any 
  2651. three dimensional point and use its x, y, and z coordinates in the above 
  2652. equation, the answer will be 0 if the point is on the surface of the object. 
  2653. The answer will be negative if the point is inside the object and positive if 
  2654. the point is outside the object. Here are some examples: 
  2655.  
  2656.         X^2 + Y^2 + Z^2 - 1 = 0  Sphere
  2657.         X^2 + Y^2 - 1 = 0        Infinitely long cylinder along the Z axis
  2658.         X^2 + Y^2 - Z^2 = 0      Infinitely long cone along the Z axis
  2659.  
  2660. The easiest way to use these shapes is to include the standard file 
  2661. "SHAPES.INC" into your program. It contains several pre-defined quadrics and 
  2662. you can transform these pre-defined shapes (using translate, rotate, and scale) 
  2663. into the ones you want. 
  2664.  
  2665. You can invoke them by using the syntax, 
  2666.  
  2667.         object { Quadric_Name }
  2668.  
  2669. The pre-defined quadrics are centered about the origin <0, 0, 0> and have a 
  2670. radius of 1. Don't confuse radius with width. The radius is half the diameter 
  2671. or width making the standard quadrics 2 units wide. 
  2672.  
  2673. Some of the pre-defined quadrics are, 
  2674.  
  2675. o Ellipsoid 
  2676.  
  2677. o Cylinder_X, Cylinder_Y, Cylinder_Z 
  2678.  
  2679. o QCone_X, QCone_Y, QCone_Z 
  2680.  
  2681. o Paraboloid_X, Paraboloid_Y, Paraboloid_Z 
  2682.  
  2683. For a complete list, see the file SHAPES.INC. 
  2684.  
  2685.  
  2686. ΓòÉΓòÉΓòÉ 6.2.3.2. 5.2.3.3  Poly, Cubic and Quartic. ΓòÉΓòÉΓòÉ
  2687.  
  2688. Higher order polynomial surfaces may be defined by the use of a poly shape. The 
  2689. syntax is: 
  2690.  
  2691.         poly { ORDER, <T1, T2, T3, .... Tm> }
  2692.  
  2693. Where ORDER is a whole number from 2 to 7 inclusively that specifies the order 
  2694. of the equation.  T1, T2... Tm are float values for the coefficients of the 
  2695. equation.  There are "m" such terms where 
  2696.  
  2697.         m=((ORDER+1)*(ORDER+2)*(ORDER+3))/6
  2698.  
  2699. An alternate way to specify 3rd order polys is: 
  2700.  
  2701.         cubic { <T1, T2,... T20> }
  2702.  
  2703. Also 4th order equations may be specified with: 
  2704.  
  2705.         quartic { <T1, T2,... T35> }
  2706.  
  2707. Here's a more mathematical description of quartics for those who are 
  2708. interested.  Quartic surfaces are 4th order surfaces, and can be used to 
  2709. describe a large class of shapes including the torus, the lemniscate, etc. The 
  2710. general equation for a quartic equation in three variables is (hold onto your 
  2711. hat): 
  2712.  
  2713.         a00 x^4 + a01 x^3 y + a02 x^3 z+ a03 x^3 + a04 x^2 y^2+
  2714.         a05 x^2 y z+ a06 x^2 y + a07 x^2 z^2+a08 x^2 z+a09 x^2+
  2715.         a10 x y^3+a11 x y^2 z+ a12 x y^2+a13 x y z^2+a14 x y z+
  2716.         a15 x y + a16 x z^3 + a17 x z^2 + a18 x z + a19 x+
  2717.         a20 y^4 + a21 y^3 z + a22 y^3+ a23 y^2 z^2 +a24 y^2 z+
  2718.         a25 y^2 + a26 y z^3 + a27 y z^2 + a28 y z + a29 y+
  2719.         a30 z^4 + a31 z^3 + a32 z^2 + a33 z + a34
  2720.  
  2721. To declare a quartic surface requires that each of the coefficients (a0 -> a34) 
  2722. be placed in order into a single long vector of 35 terms. 
  2723.  
  2724. As an example let's define a torus the hard way.  A Torus can be represented by 
  2725. the equation: 
  2726.  
  2727.         x^4 + y^4 + z^4 + 2 x^2 y^2 + 2 x^2 z^2 + 2 y^2 z^2
  2728.         -2 (r0^2 + r1^2) x^2 + 2 (r0^2 - r1^2) y^2
  2729.         -2 (r0^2 + r1^2) z^2 + (r0^2 - r1^2)^2 = 0
  2730.  
  2731. Where r0 is the "major" radius of the torus - the distance from the hole of the 
  2732. donut to the middle of the ring of the donut, and r1 is the "minor" radius of 
  2733. the torus - the distance from the middle of the ring of the donut to the outer 
  2734. surface. The following object declaration is for a torus having major radius 
  2735. 6.3 minor radius 3.5 (Making the maximum width just under 10). 
  2736.  
  2737.         //Torus having major radius sqrt(40), minor radius sqrt(12)
  2738.  
  2739.         quartic {
  2740.            < 1,   0,   0,   0,   2,   0,   0,   2,   0,
  2741.             -104,   0,   0,   0,   0,   0,   0,   0,   0,
  2742.              0,   0,   1,   0,   0,   2,   0,  56,   0,
  2743.              0,   0,   0,   1,   0, -104,  0, 784 >
  2744.              sturm
  2745.         bounded_by { // bounded_by speeds up the render,
  2746.                      // see bounded_by
  2747.                      // explanation later
  2748.                      // in docs for more info.
  2749.           sphere { <0, 0, 0>, 10 }
  2750.          }
  2751.         }
  2752.  
  2753. Poly, cubic and quartics are just like quadrics in that you don't have to 
  2754. understand what one is to use one. The file SHAPESQ.INC has plenty of pre- 
  2755. defined quartics for you to play with. The most common one is the torus or 
  2756. donut. The syntax for using a pre-defined quartic is: 
  2757.  
  2758.         object { Quartic_Name }
  2759.  
  2760. As with the other shapes, these shapes can be translated, rotated, and scaled. 
  2761. Because they are infinite they do not respond to automatic bounding.  They can 
  2762. be used freely in CSG because they have a clear defined "inside". 
  2763.  
  2764. Polys use highly complex computations and will not always render perfectly. If 
  2765. the surface is not smooth, has dropouts, or extra random pixels, try using the 
  2766. optional keyword "sturm" in the definition. This will cause a slower, but more 
  2767. accurate calculation method to be used. Usually, but not always, this will 
  2768. solve the problem. If sturm doesn't work, try rotating, or translating the 
  2769. shape by some small amount. See the sub-directory MATH for examples of polys in 
  2770. scenes. 
  2771.  
  2772. There are really so many different quartic shapes, we can't even begin to list 
  2773. or describe them all. If you are interested and mathematically inclined, an 
  2774. excellent reference book for curves and surfaces where you'll find more quartic 
  2775. shape formulas is: 
  2776.  
  2777.         "The CRC Handbook of Mathematical Curves and Surfaces"
  2778.         David von Seggern
  2779.         CRC Press
  2780.         1990
  2781.  
  2782.  
  2783. ΓòÉΓòÉΓòÉ 6.2.4. 5.2.4  Constructive Solid Geometry (CSG) ΓòÉΓòÉΓòÉ
  2784.  
  2785. POV-Ray supports Constructive Solid Geometry (also called Boolean operations) 
  2786. in order to make the shape definition abilities more powerful. 
  2787.  
  2788.  
  2789. ΓòÉΓòÉΓòÉ 6.2.4.1. 5.2.4.1  About CSG ΓòÉΓòÉΓòÉ
  2790.  
  2791. The simple shapes used so far are nice, but not terribly useful on their own 
  2792. for making realistic scenes. It's hard to make interesting objects when you're 
  2793. limited to spheres, boxes, cylinders, planes, and so forth. 
  2794.  
  2795. Constructive Solid Geometry (CSG) is a technique for taking these simple 
  2796. building blocks and combining them together. You can use a cylinder to bore a 
  2797. hole through a sphere. You can start with solid blocks and carve away pieces. 
  2798. Objects may be combined in groups and treated as though they were single 
  2799. objects. 
  2800.  
  2801. Constructive Solid Geometry allows you to define shapes which are the union, 
  2802. intersection, or difference of other shapes.  Additionally you may clip 
  2803. sections of objects revealing their hollow interiors. 
  2804.  
  2805. Unions superimpose two or more shapes. This has the same effect as defining two 
  2806. or more separate objects, but is simpler to create and/or manipulate. In 
  2807. POV-Ray 2.0 the union keyword may be used anyplace composite was used in 
  2808. previous versions of POV-Ray.  Also a new type of union called "merge" can 
  2809. eliminate internal surfaces on transparent or clipped objects. 
  2810.  
  2811. Intersections define the space where the two or more surfaces overlap. 
  2812.  
  2813. Differences allow you to cut one object out of another. 
  2814.  
  2815. CSG intersections, unions, and differences can consist of two or more shapes. 
  2816. For example: 
  2817.  
  2818.         union {
  2819.           object{O1}
  2820.           object{O2}
  2821.           object{O3}  // any number of objects
  2822.           texture{T1}
  2823.         }
  2824.  
  2825. CSG shapes may be used in CSG shapes. In fact, CSG shapes may be used anyplace 
  2826. that a standard shape is used. 
  2827.  
  2828. The order of the component shapes with the CSG doesn't matter except in a 
  2829. difference shape. For CSG differences, the first shape is visible and the 
  2830. remaining shapes are cut out of the first. 
  2831.  
  2832. Constructive solid geometry shapes may be translated, rotated, or scaled in the 
  2833. same way as any shape. The shapes making up the CSG shape may be individually 
  2834. translated, rotated, and scaled as well. 
  2835.  
  2836. When using CSG, it is often useful to invert a shape so that it's inside- out. 
  2837. The appearance of the shape is not changed, just the way that POV-Ray perceives 
  2838. it. The inverse keyword can be used to do this for any shape. When inverse is 
  2839. used, the "inside" of the shape is flipped to become the "outside". For planes, 
  2840. "inside" is defined to be "in the opposite direction to the "normal" or "up" 
  2841. direction. 
  2842.  
  2843. Note that performing an intersection between a shape and some other inverse 
  2844. shapes is the same as performing a difference. In fact, the difference is 
  2845. actually implemented in this way in the code. 
  2846.  
  2847.  
  2848. ΓòÉΓòÉΓòÉ 6.2.4.2. 5.2.4.2  Inside and outside ΓòÉΓòÉΓòÉ
  2849.  
  2850. Most shape primitives, like spheres, boxes, and blobs, divide the world into 
  2851. two regions. One region is inside the surface and one is outside. (The 
  2852. exceptions to this rule are triangles, disc and bezier patches - we'll talk 
  2853. about this later.) 
  2854.  
  2855. Given any point in space, you can say it's either inside or outside any 
  2856. particular primitive object (well, it could be exactly on the surface, but 
  2857. numerical inaccuracies will put it to one side or the other). 
  2858.  
  2859. Even planes have an inside and an outside. By definition, the surface normal of 
  2860. the plane points towards the outside of the plane. (For a simple floor, for 
  2861. example, the space above the floor is "outside" and the space below the floor 
  2862. is "inside". For simple floors this in un-important, but for planes as parts of 
  2863. CSG's it becomes much more important). CSG uses the concepts of inside and 
  2864. outside to combine shapes together. Take the following situation: 
  2865.  
  2866. Note: The diagrams shown here demonstrate the concepts in 2D and are intended 
  2867. only as an analogy to the 3D case. 
  2868.  
  2869. Note that the triangles and triangle-based shapes cannot be used as solid 
  2870. objects in CSG since they have no clear inside and outside. 
  2871.  
  2872. In this diagram, point 1 is inside object A only.  Point 2 is inside B only. 
  2873. Point 3 is inside both A and B while point 0 is outside everything. 
  2874.  
  2875.         * = Object A
  2876.         % = Object B
  2877.  
  2878.                             *  0
  2879.                            * *    %
  2880.                           *   *  % %
  2881.                          *     *%   %
  2882.                         *  1   %*    %
  2883.                        *      %  * 2  %
  2884.                       *      % 3  *    %
  2885.                      *******%*******    %
  2886.                            %             %
  2887.                           %%%%%%%%%%%%%%%%%
  2888.  
  2889. Complex shapes may be created by combining other shapes using a technique 
  2890. called "Constructive Solid Geometry" (or CSG for short).  The CSG shapes are 
  2891. difference, intersection, and union. The following gives a simple 2D overview 
  2892. of how these functions work. 
  2893.  
  2894.  
  2895. ΓòÉΓòÉΓòÉ 6.2.4.3. 5.2.4.3  Union ΓòÉΓòÉΓòÉ
  2896.  
  2897. Unions are simply "glue", used bind two or more shapes into a single entity 
  2898. that can be manipulated as a single object.  The diagram above shows the union 
  2899. of A and B.  The new object created by the union operation can then be scaled, 
  2900. translated, and rotated as a single shape.  The entire union can share a single 
  2901. texture, but each object contained in the union may also have its own texture, 
  2902. which will override any matching texture statements in the parent object: 
  2903.  
  2904.         union {
  2905.           sphere { <0, 0.5, 0> 1 pigment { Red } }
  2906.           sphere { <0, 0.0, 0> 1 }
  2907.           sphere { <0,-0.5, 0> 1 }
  2908.           pigment { Blue }
  2909.           finish { Shiny }
  2910.         }
  2911.  
  2912. This union will contain three spheres.  The first sphere is explicitly colored 
  2913. Red while the other two will be shiny blue. Note that the shiny finish does NOT 
  2914. apply to the first sphere. This is because the "pigment{Red}" is actually 
  2915. shorthand for "texture{pigment{Red}}".  It attaches an entire texture with 
  2916. default normals and finish.  The textures or pieces of textures attached to the 
  2917. union apply ONLY to components with no textures.  These texturing rules also 
  2918. apply to intersection, difference and merge as well. 
  2919.  
  2920. Earlier versions of POV-Ray placed restrictions on unions so you often had to 
  2921. combine objects with composite statements.  Those earlier restrictions have 
  2922. been lifted so composite is no longer needed.  Composite is still supported for 
  2923. backwards compatibility but it is recommended that union now be used in it's 
  2924. place since future support for the composite keyword is not guarantied. 
  2925.  
  2926.  
  2927. ΓòÉΓòÉΓòÉ 6.2.4.4. 5.2.4.4  Intersection ΓòÉΓòÉΓòÉ
  2928.  
  2929. A point is inside the intersection if it's inside both A AND B. This "logical 
  2930. AND's" the shapes and gets the common part, most useful for "cutting" infinite 
  2931. shapes off.  The diagram below consists of only those parts common to A and B. 
  2932.  
  2933.                                %*
  2934.                               %  *
  2935.                              % 3  *
  2936.                             %*******
  2937.  
  2938. For example: 
  2939.  
  2940.         intersection {
  2941.           sphere {<-0.75,0,0>,1}
  2942.           sphere {< 0.75,0,0>,1}
  2943.           pigment {Yellow}
  2944.         }
  2945.  
  2946.  
  2947. ΓòÉΓòÉΓòÉ 6.2.4.5. 5.2.4.5  Difference ΓòÉΓòÉΓòÉ
  2948.  
  2949. A point is inside the difference if it's inside A but not inside B. The results 
  2950. is a "subtraction" of the 2nd shape from the first shape: 
  2951.  
  2952.                             *
  2953.                            * *
  2954.                           *   *
  2955.                          *     *
  2956.                         *  1   %
  2957.                        *      %
  2958.                       *      %
  2959.                      *******%
  2960.  
  2961. For example: 
  2962.  
  2963.         difference {
  2964.           sphere {<-0.75,0,0>,1}
  2965.           sphere {< 0.75,0,-0.25>,1}
  2966.           pigment {Yellow}
  2967.         }
  2968.  
  2969.  
  2970. ΓòÉΓòÉΓòÉ 6.2.4.6. 5.2.4.6  Merge ΓòÉΓòÉΓòÉ
  2971.  
  2972. As can be seen in the diagram for union, the inner surfaces where the objects 
  2973. overlap is still present.  On transparent or clipped objects these inner 
  2974. surfaces cause problems.  A merge object works just like union but it 
  2975. eliminates the inner surfaces like this: 
  2976.  
  2977.                             *
  2978.                            * *    %
  2979.                           *   *  % %
  2980.                          *     *%   %
  2981.                         *            %
  2982.                        *              %
  2983.                       *                %
  2984.                      *******%           %
  2985.                            %             %
  2986.                           %%%%%%%%%%%%%%%%%
  2987.  
  2988.  
  2989. ΓòÉΓòÉΓòÉ 6.2.5. 5.2.5  Light Sources ΓòÉΓòÉΓòÉ
  2990.  
  2991. The last object we'll cover is the light source.  Light sources have no visible 
  2992. shape of their own.  They are just points or areas which emit light. 
  2993.  
  2994.  
  2995. ΓòÉΓòÉΓòÉ 6.2.5.1. 5.2.5.1  Point Lights ΓòÉΓòÉΓòÉ
  2996.  
  2997. Most light sources are infinitely small points which emit light.  Point light 
  2998. sources are treated like shapes, but they are invisible points from which light 
  2999. rays stream out. They light objects and create shadows and highlights. Because 
  3000. of the way ray tracing works, lights do not reflect from a surface.  You can 
  3001. use many light sources in a scene, but each light source used will increase 
  3002. rendering time. The brightness of a light is determined by its color. A bright 
  3003. color is a bright light, a dark color, a dark one. White is the brightest 
  3004. possible light, Black is completely dark and Gray is somewhere in the middle. 
  3005.  
  3006. The syntax for a light source is: 
  3007.  
  3008.         light_source { <X, Y, Z> color red #, green #, blue #}
  3009.  
  3010. Where X, Y and Z are the coordinates of the location and "color" is any color 
  3011. or color identifier. For example, 
  3012.  
  3013.         light_source { <3, 5, -6> color Gray50}
  3014.  
  3015. is a 50% Gray light at X=3, Y=5, Z=-6. 
  3016.  
  3017. Point light sources in POV-Ray do not attenuate, or get dimmer, with distance. 
  3018.  
  3019.  
  3020. ΓòÉΓòÉΓòÉ 6.2.5.2. 5.2.5.2  Spotlights ΓòÉΓòÉΓòÉ
  3021.  
  3022. A spotlight is a point light source where the rays of light are constrained by 
  3023. a cone. The light is bright in the center of the spotlight and falls 
  3024. off/darkens to soft shadows at the edges of the circle. 
  3025.  
  3026. The syntax is: 
  3027.  
  3028. Syntax: light_source { <CENTER>
  3029.             color red #, green #, blue #
  3030.             spotlight
  3031.             point_at <POINT>
  3032.             radius #
  3033.             falloff #
  3034.             tightness #
  3035.         }
  3036.  
  3037. A spotlight is positioned using two vectors.  The first vector is the usual 
  3038. <CENTER> vector that you would use to position a point light source. 
  3039.  
  3040. The second vector is the point_at <POINT>, the vector position of the point the 
  3041. light is pointing at, similar to the look_at in a camera description. 
  3042.  
  3043. The following illustrations will be helpful in understanding how these values 
  3044. relate to each other: 
  3045.  
  3046.            (+) Spotlight <center>
  3047.            / \
  3048.           /   \
  3049.          /     \
  3050.         /       \
  3051.        /         \
  3052.       /           \
  3053.       +-----*-----+
  3054.             ^ point_at <point>
  3055.  
  3056. The center is specified the same way as a normal point light_source. 
  3057.  
  3058. Point_at <POINT> is the location that the cone of light is aiming at. 
  3059.  
  3060. Spotlights also have three other parameters: radius, falloff, and tightness. 
  3061.  
  3062. If you think of a spotlight as two nested cones,  the inner cone would be 
  3063. specified by the radius parameter, and would be fully lit.  The outer cone 
  3064. would be the falloff cone and beyond it would be totally unlit.  The values for 
  3065. these two parameters are specified in degrees of the half angle at the peak of 
  3066. each cone: 
  3067.  
  3068.            (+) Spotlight <center>
  3069.             |\ <-----  angle measured here
  3070.             | \
  3071.             || \
  3072.             ||  \      shaded area = radius cone
  3073.             |||  \     outer line = falloff cone
  3074.             ||||  \
  3075.             |||||  \
  3076.             +-------+
  3077.  
  3078. The radius# is the radius, in degrees, of the bright circular hotspot at the 
  3079. center of the spotlight's area of affect. 
  3080.  
  3081. The falloff# is the falloff angle of the radius of the total spotlight area, in 
  3082. degrees. This is the value where the light "falls off" to zero brightness. 
  3083. Falloff should be larger than the radius. Both values should be between 1 and 
  3084. 180. 
  3085.  
  3086. The tightness value specifies how quickly the light dims, or falls off, in the 
  3087. region between the radius (full brightness) cone and the falloff (full 
  3088. darkness) cone.  The default value for tightness is 10.  Lower tightness values 
  3089. will make the spot have very soft edges. High values will make the edges 
  3090. sharper, the spot "tighter".  Values from 1 to 100 are acceptable. 
  3091.  
  3092. Spotlights may used anyplace that a normal light source is used. Like normal 
  3093. light sources, they are invisible points. They are treated as shapes and may be 
  3094. included in CSG shapes.  They may also be used in conjunction with area_lights. 
  3095.  
  3096. Example: 
  3097.  
  3098.         // This is the spotlight.
  3099.         light_source {
  3100.                <10, 10, 0>
  3101.                color red 1, green 1, blue 0.5
  3102.                spotlight
  3103.                point_at <0, 1, 0>
  3104.                tightness 50
  3105.                radius 11
  3106.                falloff 25
  3107.         }
  3108.  
  3109.  
  3110. ΓòÉΓòÉΓòÉ 6.2.5.3. 5.2.3.3  Area Lights ΓòÉΓòÉΓòÉ
  3111.  
  3112. Regular light sources in POV-Ray are modeled as point light sources, that is 
  3113. they emit light from a single point in space. Because of this the shadows 
  3114. created by these lights have the characteristic sharp edges that most of us are 
  3115. use to seeing in ray traced images. The reason for the distinct edges is that a 
  3116. point light source is either fully in view or it is fully blocked by an object. 
  3117. A point source can never be partially blocked. 
  3118.  
  3119. Area lights on the other hand occupy a finite area of space. Since it is 
  3120. possible for an area light to be partially blocked by an object the shadows 
  3121. created will have soft or "fuzzy" edges. The softness of the edge is dependent 
  3122. on the dimensions of the light source and it's distance from the object casting 
  3123. the shadow. 
  3124.  
  3125. The area lights used in POV-Ray are rectangular in shape, sort of like a flat 
  3126. panel light. Rather than performing the complex calculations that would be 
  3127. required to model a true area light, POV-Ray approximates an area light as an 
  3128. array of "point" light sources spread out over the area occupied by the light. 
  3129. The intensity of each individual point light in the array is dimmed so that the 
  3130. total amount of light emitted by the light is equal to the light color 
  3131. specified in the declaration. 
  3132.  
  3133. Syntax: 
  3134.  
  3135.         light_source {
  3136.                <X, Y, Z> color red # green # blue #
  3137.  
  3138.                area_light <X1, Y1, Z1>, <X2, Y2, Z2>, N1, N2
  3139.                adaptive #
  3140.                jitter
  3141.  
  3142.                    [optional spotlight parameters]
  3143.         }
  3144.  
  3145. The light's location and color are specified in the same way as a regular light 
  3146. source. 
  3147.  
  3148. The area_light command defines the size and orientation of the area light as 
  3149. well as the number of lights in the light source array.  The vectors <X1,Y1,Z1> 
  3150. and <X2,Y2,Z2> specify the lengths and directions of the edges of the light. 
  3151. Since the area lights are rectangular in shape these vectors should be 
  3152. perpendicular to each other. The larger the size of the light the thicker that 
  3153. the soft part of the shadow will be. The numbers N1 and N2 specify the 
  3154. dimensions of the array of point lights. The larger the number of lights you 
  3155. use the smoother your shadows will be but the longer they will take to render. 
  3156.  
  3157. The adaptive command is used to enable adaptive sampling of the light source. 
  3158. By default POV-Ray calculates the amount of light that reaches a surface from 
  3159. an area light by shooting a test ray at every point light within the array. As 
  3160. you can imagine this is VERY slow. Adaptive sampling on the other hand attempts 
  3161. to approximate the same calculation by using a minimum number of test rays. The 
  3162. number specified after the keyword controls how much adaptive sampling is used. 
  3163. The higher the number the more accurate your shadows will be but the longer 
  3164. they will take to render. If you're not sure what value to use a good starting 
  3165. point is 'adaptive 1'. The adaptive command only accepts integer values and 
  3166. cannot be set lower than 0. Adaptive sampling is explained in more detail 
  3167. later. 
  3168.  
  3169. The jitter command is optional. When used it causes the positions of the point 
  3170. lights in the array to be randomly jittered to eliminate any shadow banding 
  3171. that may occur. The jittering is completely random from render to render and 
  3172. should not be used when generating animations. 
  3173.  
  3174. Note: It's possible to specify spotlight parameters along with area_light 
  3175. parameters to create "area spotlights." Using area spotlights is a good way to 
  3176. speed up scenes that use area lights since you can confine the lengthy soft 
  3177. shadow calculations to only the parts of your scene that need them. 
  3178.  
  3179. Example: 
  3180.  
  3181.         light_source {
  3182.                <0, 50, 0> color White
  3183.  
  3184.                area_light <5, 0, 0>, <0, 0, 10>, 5, 5
  3185.                adaptive 1
  3186.                jitter
  3187.         }
  3188.  
  3189. This defines an area light that extends 5 units along the x axis and 10 units 
  3190. along the z axis and is centered at the location <0,50,0>. The light consists 
  3191. of a 5 by 5 jittered array of point sources for a total of 25 point lights. A 
  3192. minimum of 9 shadow rays will be used each time this light is tested. 
  3193.  
  3194.                      / * * * * *
  3195.                    / * * * * *           Y
  3196.         <0,0,10> / * * * * *             |     Z
  3197.                / * * * * *               |   /
  3198.              / * * * * *                 | /
  3199.            +----------->                 +------X
  3200.               <5,0,0>
  3201.  
  3202. An interesting effect that can be created using area lights is a linear light. 
  3203. Rather than having a rectangular shape, a linear light stretches along a line 
  3204. sort of like a thin fluorescent tube. To create a linear light just create an 
  3205. area light with one of the array dimensions set to 1. 
  3206.  
  3207. Example: 
  3208.  
  3209.         light_source {
  3210.                <0, 50, 0> color White
  3211.  
  3212.                area_light <40, 0, 0>, <0, 0, 1>, 100, 1
  3213.                adaptive 4
  3214.                jitter
  3215.         }
  3216.  
  3217. This defines a linear light that extends from <-40/2,50,0> to <+40/2,50,0> and 
  3218. consists of 100 point sources along it's length. The vector <0,0,1> is ignored 
  3219. in this case since a linear light has no width. Note: If the linear light is 
  3220. fairly long you'll usually need to set the adaptive parameter fairly high as in 
  3221. the above example. 
  3222.  
  3223. When performing adaptive sampling POV-Ray starts by shooting a test ray at each 
  3224. of the four corners of the area light. If the amount of light received from all 
  3225. four corners is approximately the same then the area light is assumed to be 
  3226. either fully in view or fully blocked. The light intensity is then calculated 
  3227. as the average intensity of the light received from the four corners.  However, 
  3228. if the light intensity from the four corners differs significantly then the 
  3229. area light is partially blocked. The light is the split into four quarters and 
  3230. each section is sampled as described above. This allows POV-Ray to rapidly 
  3231. approximate how much of the area light is in view without having to shoot a 
  3232. test ray at every light in the array. 
  3233.  
  3234. While the adaptive sampling method is fast (relatively speaking) it can 
  3235. sometimes produces inaccurate shadows. The solution is to reduce the amount of 
  3236. adaptive sampling without completely turning it off. The number after the 
  3237. adaptive keyword adjusts the number of times that the area light will be split 
  3238. before the adaptive phase begins. For example if you use "adaptive 0" a minimum 
  3239. of 4 rays will be shot at the light. If you use "adaptive 1" a minimum of 9 
  3240. rays will be shot (adaptive 2 = 25 rays, adaptive 3 = 81 rays, etc). Obviously 
  3241. the more shadow rays you shoot the slower the rendering will be so you should 
  3242. use the lowest value that gives acceptable results. 
  3243.  
  3244. The number of rays never exceeds the values you specify for rows and columns of 
  3245. points.  For example: area_light x,y,4,4 specifies a 4 by 4 array of lights. 
  3246. If you specify adaptive 3 it would mean that you should start with a 5 by 5 
  3247. array.  In this case no adaptive sampling is done.  The 4 by 4 array is used. 
  3248.  
  3249.  
  3250. ΓòÉΓòÉΓòÉ 6.2.5.4. 5.2.3.4  Looks_like ΓòÉΓòÉΓòÉ
  3251.  
  3252. Normally the light source itself has no visible shape.  The light simply 
  3253. radiates from an invisible point or area.  You may give a light source a any 
  3254. shape by adding a "looks_like{OBJECT}" statement.  For example: 
  3255.  
  3256.         light_source {
  3257.                <100,200,-300> color White
  3258.                looks_like {sphere{<0,0,0>,1 texture{T1}}
  3259.         }
  3260.  
  3261. This creates a visible sphere which is automatically translated to the light's 
  3262. location <100,200,-300> even though the sphere has <0,0,0> as its center. 
  3263. There is an implied "no_shadow" also attached to the sphere so that light is 
  3264. not blocked by the sphere.  Without the automatic no_shadow, the light inside 
  3265. the sphere would not escape. The sphere would, in effect, cast a shadow over 
  3266. everything. 
  3267.  
  3268. If you want the attached object to block light then you should attach it with a 
  3269. union and not a looks_like as follows: 
  3270.  
  3271.         union {
  3272.           light_source {<100,200,-300> color White}
  3273.           object {My_Lamp_Shade}
  3274.         }
  3275.  
  3276. Presumably parts of the lamp shade are open to let SOME light out. 
  3277.  
  3278.  
  3279. ΓòÉΓòÉΓòÉ 6.3. 5.3  Object Modifiers ΓòÉΓòÉΓòÉ
  3280.  
  3281. A variety of modifiers may be attached to objects.  Transformations such as 
  3282. translate, rotate and scale have already been discussed.  Textures are in a 
  3283. section of their own below.  Here are three other important modifiers: 
  3284. clipped_by, bounded_by and no_shadow.  Although the examples below use object 
  3285. statements and object identifiers, these modifiers may be used on any type of 
  3286. object such as sphere, box etc. 
  3287.  
  3288.  
  3289. ΓòÉΓòÉΓòÉ 6.3.1. 5.3.1  Clipped_By ΓòÉΓòÉΓòÉ
  3290.  
  3291. The "clipped_by" statement is technically an object modifier but it provides a 
  3292. type of CSG similar to CSG intersection.  You attach a clipping object like 
  3293. this: 
  3294.  
  3295.         object {
  3296.            My_Thing
  3297.            clipped_by{plane{y,0}}
  3298.         }
  3299.  
  3300. Every part of the object "My_Thing" that is inside the plane is retained while 
  3301. the remaining part is clipped off and discarded.  In an intersection object, 
  3302. the hole is closed off.  With clipped_by it leaves an opening.  For example 
  3303. this diagram shows our object "A" being clipped_by a plane{y,0}. 
  3304.  
  3305.                        *       *
  3306.                       *         *
  3307.                      *           *
  3308.                     ***************
  3309.  
  3310. Clipped_by may be used to slice off portions of any shape. In many cases it 
  3311. will also result in faster rendering times than other methods of altering a 
  3312. shape. 
  3313.  
  3314. Often you will want to use the clipped_by and bounded_by options with the same 
  3315. object.  The following shortcut saves typing and uses less memory. 
  3316.  
  3317.         object {
  3318.            My_Thing
  3319.            bounded_by{box{<0,0,0>,<1,1,1>}}
  3320.            clipped_by{bounded_by}
  3321.         }
  3322.  
  3323. This tells POV-Ray to use the same box as a clip that was used as a bounds. 
  3324.  
  3325.  
  3326. ΓòÉΓòÉΓòÉ 6.3.2. 5.3.1  Bounded_By ΓòÉΓòÉΓòÉ
  3327.  
  3328. The calculations necessary to test if a ray hits an object can be quite time 
  3329. consuming.  Each ray has to be tested against every object in the scene. 
  3330. POV-Ray attempts so speed up the process by building a set of invisible boxes, 
  3331. called bounding slabs, which cluster the objects together. This way a ray that 
  3332. travels in one part of the scene doesn't have to be tested against objects in 
  3333. another far away part of the scene.  When large number objects are present the 
  3334. slabs are nested inside each other.  POV-Ray can use slabs on any finite 
  3335. object.  However infinite objects such as plane, quadric, quartic, cubic & poly 
  3336. cannot be automatically bound.  Also CSG objects cannot be efficiently bound by 
  3337. automatic methods.  By attaching a bounded_by statement to such shapes you can 
  3338. speed up the testing of the shape and make it capable of using bounding slabs. 
  3339.  
  3340. If you use bounding shapes around any complex objects you can speed up the 
  3341. rendering. Bounding shapes tell the ray tracer that the object is totally 
  3342. enclosed by a simple shape. When tracing rays, the ray is first tested against 
  3343. the simple bounding shape. If it strikes the bounding shape, then the ray is 
  3344. further tested against the more complicated object inside. Otherwise the entire 
  3345. complex shape is skipped, which greatly speeds rendering. 
  3346.  
  3347. To use bounding shapes, simply include the following lines in the declaration 
  3348. of your object: 
  3349.  
  3350.         bounded_by {
  3351.           object { ... }
  3352.         }
  3353.  
  3354. An example of a Bounding Shape: 
  3355.  
  3356.         intersection {
  3357.           sphere {<0,0,0>, 2}
  3358.           plane  {<0,1,0>, 0}
  3359.           plane  {<1,0,0>, 0}
  3360.           bounded_by {sphere {<0,0,0>, 2}}
  3361.         }
  3362.  
  3363. The best bounding shape is a sphere or a box since these shapes are highly 
  3364. optimized, although, any shape may be used.  If the bounding shape is itself a 
  3365. finite shape which responds to bounding slabs then the object which it encloses 
  3366. will also be used in the slab system. 
  3367.  
  3368. CSG shapes can benefit from bounding slabs without a bounded_by statement 
  3369. however they may do so inefficiently in intersection, difference and merge. In 
  3370. these three CSG types the automatic bound used covers all of the component 
  3371. objects in their entirety.  However the result of these intersections may 
  3372. result in a smaller object.  Compare the sizes of the illustrations for union 
  3373. and intersection in the CSG section above.  It is possible to draw a much 
  3374. smaller box around the intersection of A and B than the union of A and B yet 
  3375. the automatic bounds are the size of union{A B} regardless of the kind of CSG 
  3376. specified. 
  3377.  
  3378. While it is almost always a good idea to manually add a bounded_by to 
  3379. intersection, difference and merge, it is often best to NOT bound a union. If a 
  3380. union has no bounded_by and no clipped_by then POV-Ray can internally split 
  3381. apart the components of a union and apply automatic bounding slabs to any of 
  3382. its finite parts. Note that some utilities such as RAW2POV may be able to 
  3383. generate bounds more efficiently than POV-Ray's current system. However most 
  3384. unions you create yourself can be easily bounded by the automatic system.  For 
  3385. technical reasons POV-Ray cannot split a merge object.  It is probably best to 
  3386. hand bound a merge, especially if it is very complex. 
  3387.  
  3388. Note that if bounding shape is too small or positioned incorrectly, it may clip 
  3389. the object in undefined ways or the object may not appear at all. To do true 
  3390. clipping, use clipped_by as explained above. Often you will want to use the 
  3391. clipped_by and bounded_by options with the same object.  The following shortcut 
  3392. saves typing and uses less memory. 
  3393.  
  3394.         object {
  3395.           My_Thing
  3396.           clipped_by{box{<0,0,0>,<1,1,1>}}
  3397.           bounded_by{clipped_by}
  3398.         }
  3399.  
  3400. This tells POV-Ray to use the same box as a bounds that was used as a clip. 
  3401.  
  3402.  
  3403. ΓòÉΓòÉΓòÉ 6.3.3. 5.3.2  No_Shadow ΓòÉΓòÉΓòÉ
  3404.  
  3405. You may specify the no_shadow keyword in object and that object will not cast a 
  3406. shadow.  This is useful for special effects and for creating the illusion that 
  3407. a light source actually is visible.  This keyword was necessary in earlier 
  3408. versions of POV-Ray which did not have the "looks_like" statement.  Now it is 
  3409. useful for creating things like laser beams or other unreal effects. 
  3410.  
  3411. Simply attach the keyword as follows: 
  3412.  
  3413.         object {
  3414.           My_Thing
  3415.           no_shadow
  3416.         }
  3417.  
  3418.  
  3419. ΓòÉΓòÉΓòÉ 6.4. 5.4  Textures ΓòÉΓòÉΓòÉ
  3420.  
  3421. Textures are the materials from which the objects in POV-Ray are made. They 
  3422. specifically describe the surface coloring, shading, and properties like 
  3423. transparency and reflection. 
  3424.  
  3425. You can create your own textures using the parameters described below, or you 
  3426. can use the many pre-defined high quality textures that have been provided in 
  3427. the files TEXTURES.INC and STONES.INC. The tutorial in section 4 above 
  3428. introduces the basics of defining textures and attaching them to objects.  It 
  3429. explains how textures are made up of three portions, a color pattern called 
  3430. "pigment", a bump pattern called "normal", and surface properties called 
  3431. "finish". 
  3432.  
  3433. The most complete form for defining a texture is as follows: 
  3434.  
  3435.         texture {
  3436.           TEXTURE_IDENTIFIER
  3437.           pigment {...}
  3438.           normal {...}
  3439.           finish {...}
  3440.           TRANSFORMATIONS...
  3441.         }
  3442.  
  3443. Each of the items in a texture are optional but if they are present, the 
  3444. identifier must be first and the transformations bust be last.  The pigment, 
  3445. normal and finish parameters modify any pigment, normal and finish already 
  3446. specified in the TEXTURE_IDENTIFIER.  If no texture identifier is specified 
  3447. then the pigment, normal and finish statements modify the current default 
  3448. values.  TRANSFORMATIONs are translate, rotate and scale statements.  They 
  3449. should be specified last. 
  3450.  
  3451. The sections below describe all of the options available in pigments, normals 
  3452. and finishes. 
  3453.  
  3454.  
  3455. ΓòÉΓòÉΓòÉ 6.4.1. 5.4.1  Pigment ΓòÉΓòÉΓòÉ
  3456.  
  3457. The color or pattern of colors for an object is defined by a pigment statement. 
  3458. A pigment statement is part of a texture specification. However it can be 
  3459. tedious to type "texture{pigment{...}}" just to add a color to an object. 
  3460. Therefore you may attach a pigment directly to an object without explicitly 
  3461. specifying that it as part of a texture.  For example... 
  3462.  
  3463.         this...                        can be shortened to this...
  3464.  
  3465.         object {                           object {
  3466.           My_Object                          My_Object
  3467.           texture {                          pigment {color Purple}
  3468.           pigment {color Purple}         }
  3469.          }
  3470.         }
  3471.  
  3472. The color you define is the way you want it to look if fully illuminated. You 
  3473. pick the basic color inherent in the object and POV-Ray brightens or darkens it 
  3474. depending on the lighting in the scene.  The parameter is called "pigment" 
  3475. because we are defining the basic color the object actually IS rather than how 
  3476. it LOOKS. 
  3477.  
  3478. The most complete form for defining a pigment is as follows: 
  3479.  
  3480.         pigment {
  3481.           PIGMENT_IDENTIFIER
  3482.           PATTERN_TYPE
  3483.           PIGMENT_MODIFIERS
  3484.           TRANSFORMATIONS...
  3485.         }
  3486.  
  3487. Each of the items in a pigment are optional but if they are present, they 
  3488. should be in the order shown above to insure that the results are as expected. 
  3489. Any items after the PIGMENT_IDENTIFIER modify or override settings given in the 
  3490. IDENTIFIER.  If no identifier is specified then the items modify the pigment 
  3491. values in the current default texture. TRANSFORMATIONs are translate, rotate 
  3492. and scale statements.  They apply only to the pigment and not to other parts of 
  3493. the texture.  They should be specified last. 
  3494.  
  3495. The various PATTERN_TYPEs fall into roughly 4 categories.  Each category is 
  3496. discussed below.  They are solid color, color list patterns, color mapped 
  3497. patterns and image maps. 
  3498.  
  3499.  
  3500. ΓòÉΓòÉΓòÉ 6.4.1.1. 5.4.1.1  Color ΓòÉΓòÉΓòÉ
  3501.  
  3502. The simplest type of pigment is a solid color.  To specify a solid color you 
  3503. simply put a color specification inside a pigment.  For example... 
  3504.  
  3505.         pigment {color Orange}
  3506.  
  3507. A color specification consists of the keyword "color" followed a color 
  3508. identifier or by a specification of the amount or red, green, blue and 
  3509. transparency in the surface.  For example: 
  3510.  
  3511.         color red 0.5   green 0.2   blue 1.0
  3512.  
  3513. The float values between 0.0 and 1.0 are used to specify the intensity of each 
  3514. primary color of light. Note that we use additive color primaries like the 
  3515. color phosphors on a color computer monitor or TV. Thus.... 
  3516.  
  3517.         color red 1.0   green 1.0   blue 1.0
  3518.  
  3519.  ...specifies full intensity of all primary colors which is white light. The 
  3520. primaries may be given in any order and if any primary is unspecified its value 
  3521. defaults to zero. 
  3522.  
  3523. In addition to the primary colors a 4th value called "filter" specifies the 
  3524. amount of transparency.  For example a piece of red tinted cellophane might 
  3525. have... 
  3526.  
  3527.         color red 1.0  filter 1.0
  3528.  
  3529. Lowering the filter value would let less light through.  The default value if 
  3530. no filter is specified is 0.0 or no transparency. Note that the example has an 
  3531. implied "green 0.0  blue 0.0" which means that no green or blue light can pass 
  3532. through. Often users mistakenly specify a clear object by... 
  3533.  
  3534.         color filter 1.0
  3535.  
  3536. but this has implied red, green and blue values of zero.  You've just specified 
  3537. a totally black filter so no light passes through.  The correct way is... 
  3538.  
  3539.         color red 1.0   green 1.0   blue 1.0   filter 1.0
  3540.  
  3541. Note in earlier versions of POV-Ray the keyword "alpha" was used for 
  3542. transparency.  However common usage of "alpha" in this context usually means 
  3543. that light passes through unaffected.  In POV-Ray however, light is filtered 
  3544. when it passes through a colored surface.  The program works the same as it 
  3545. always did but the keyword has been changed to make its meaning clearer. 
  3546.  
  3547. A short-cut way to specify a color is... 
  3548.  
  3549.         color rgb<0.2, 0.5, 0.9>
  3550.  
  3551. or 
  3552.  
  3553.         color rgbf<0.2, 0.8, 1.0, 0.7>
  3554.  
  3555. Color specifications are used elsewhere in POV-Ray.  Unless stated otherwise, 
  3556. all of the above information on color specs given above applies to any color 
  3557. spec. 
  3558.  
  3559. Color identifiers may be declared.  For examples see COLORS.INC.  A color 
  3560. identifier contains red, blue, green and filter values even if they are not 
  3561. explicitly specified.  For example: 
  3562.  
  3563.         color filter 1.0 My_Color // here My_Color overwrites the filter
  3564.  
  3565.         color My_Color filter 1.0 // this changes My_Color's filter value to 1.0
  3566.  
  3567. When using a color specification to give an object a solid color pigment, the 
  3568. keyword "color" may be omitted.  For example... 
  3569.  
  3570.         pigment {red 1  blue 0.5}
  3571.  
  3572. or 
  3573.  
  3574.         pigment {My_Color}
  3575.  
  3576. are legal. 
  3577.  
  3578.  
  3579. ΓòÉΓòÉΓòÉ 6.4.1.2. 5.4.1.2  Color List Patterns -- checker and hexagon ΓòÉΓòÉΓòÉ
  3580.  
  3581. Two of the simplest color patterns available are the checker and hexagon 
  3582. patterns.  These patterns take a simple list of colors one after the other. For 
  3583. example a checker pattern is specified by... 
  3584.  
  3585.         pigment {checker color C1  color C2}
  3586.  
  3587. This produces a checkered pattern consisting of alternating squares of color C1 
  3588. and C2.  If no colors are specified then default blue and green colors are 
  3589. used. 
  3590.  
  3591. All color patterns in POV-Ray are 3 dimensional.  For every x,y,z point in 
  3592. space, the pattern has a unique color.  In the case of a checker pattern it is 
  3593. actually a series of cubes that are one unit in size.  Imagine a bunch of 1 
  3594. inch cubes made from two different colors of modeling clay.  Now imagine 
  3595. arranging the cubes in an alternating check pattern and stacking them in layer 
  3596. after layer so that the colors still alternated in every direction.  Eventually 
  3597. you would have a larger cube.  The pattern of checks on each side is what the 
  3598. POV-Ray checker pattern produces when applied to a box object.  Finally imagine 
  3599. cutting away at the cube until it is carved into a smooth sphere or any other 
  3600. shape.  This is what the checker pattern would look like on an object of any 
  3601. kind. 
  3602.  
  3603. Color patterns do not wrap around the surfaces like putting wallpaper on an 
  3604. object.  The patterns exist in 3-d and the objects are carved from them like 
  3605. carving stacked colored cubes.  In a later section we describe wood and marble 
  3606. patterns for example.  The wood grain or stone swirls exist through the whole 
  3607. object but they appear only at the surface. 
  3608.  
  3609. Another pattern that uses a list of colors is the hexagon pattern.  A hexagon 
  3610. pattern is specified by... 
  3611.  
  3612.         pigment {hexagon color C1  color C2  color C3}
  3613.  
  3614. Hex pattern generates a repeating pattern of hexagons in the XZ plane.  In this 
  3615. instance imagine tall rods that are hexagonal in shape and are parallel to the 
  3616. Y axis and grouped in bundles like this... 
  3617.  
  3618.            _____
  3619.           /     \
  3620.          /   C2  \_____
  3621.         |\       /     \
  3622.         | \_____/   C3  \
  3623.         | /     \       /|
  3624.          /   C1  \_____/ |
  3625.         |\       /|    | |
  3626.         | \_____/ |    | |
  3627.         | |     | |    | |
  3628.         | |     | |    | |
  3629.         | |     | |    | |
  3630.         | |     | |    | |
  3631.         | |     | |    |
  3632.         | |     | |    |
  3633.           |     |
  3634.           |     |
  3635.  
  3636. The three colors will repeat the pattern shown above with hexagon C1 centered 
  3637. at the origin.  Each side of the hexagon is one unit long.  The hexagonal 
  3638. "rods" of color extend infinitely in the +Y and -Y directions. If no colors are 
  3639. specified then default blue, green, and red colors are used. 
  3640.  
  3641.  
  3642. ΓòÉΓòÉΓòÉ 6.4.1.3. 5.4.1.3  Color Mapped Patterns ΓòÉΓòÉΓòÉ
  3643.  
  3644. Most of the color patterns do not use abrupt color changes of just two or three 
  3645. colors like those in the checker or hexagon patterns.  They instead use smooth 
  3646. transitions of many colors that gradually change from one point to the next. 
  3647. The colors are defined in a color map that describes how the pattern blends 
  3648. from one color to the next. 
  3649.  
  3650.  
  3651. ΓòÉΓòÉΓòÉ 6.4.1.3.1. 5.4.1.3.1  Gradient ΓòÉΓòÉΓòÉ
  3652.  
  3653. This simplest such pattern is the "gradient" pattern.  It is specified as 
  3654. follows... 
  3655.  
  3656.         pigment {gradient VECTOR}
  3657.  
  3658. where VECTOR is a vector pointing in the direction that the colors blend. For 
  3659. example: 
  3660.  
  3661.         sphere {
  3662.           <0, 1, 2>, 2
  3663.           pigment { gradient x } // bands of color vary as you move
  3664.                                  // along the "x" direction.
  3665.         }
  3666.  
  3667. This produces a series of smooth bands of color that look like layers of color 
  3668. next to each other.  Points at x=0 are black.  As the X location increases it 
  3669. smoothly turns to white at x=1.  Then it starts over with black and gradually 
  3670. turns white at x=2.  The pattern reverses for negative values of X.  Using 
  3671. "gradient y" or "gradient z" makes the colors blend along the y or z axis.  Any 
  3672. vector may be used but x, y and z are most common. 
  3673.  
  3674.  
  3675. ΓòÉΓòÉΓòÉ 6.4.1.3.2. 5.4.1.3.2  Color Maps ΓòÉΓòÉΓòÉ
  3676.  
  3677. The gray scale default colors of the gradient pattern isn't a very interesting 
  3678. sight.  The real power comes from specifying a color map to define how the 
  3679. colors should blend. 
  3680.  
  3681. Each of the various pattern types available is in fact a mathematical function 
  3682. that takes any x,y,z location and turns it into a number between 0.0 and 1.0. 
  3683. That number is used to specify what mix of colors to use from the color map. 
  3684.  
  3685. A color map is specified by... 
  3686.  
  3687.         color_map {
  3688.           [ NUM_1 color C1]
  3689.           [ NUM_2 color C2]
  3690.           [ NUM_3 color C3]
  3691.           ...
  3692.         }
  3693.  
  3694. Where NUM_1, NUM_2... are float values between 0.0 and 1.0 inclusive.  C1, C2 
  3695. ... are color specifications. NOTE: the [] brackets are part of the actual 
  3696. statement.  They are not notational symbols denoting optional parts. The 
  3697. brackets surround each entry in the color map.  There may be from 2 to 20 
  3698. entries in the map. 
  3699.  
  3700. For example, 
  3701.  
  3702.         sphere {
  3703.           <0,1,2>, 2
  3704.           pigment {
  3705.           gradient x
  3706.           color_map {
  3707.             [0.1  color Red]
  3708.             [0.3  color Yellow]
  3709.             [0.6  color Blue]
  3710.             [0.6  color Green]
  3711.             [0.8  color Cyan]
  3712.            }
  3713.           }
  3714.         }
  3715.  
  3716. The pattern function is evaluated and the result is a value from 0.0 to 1.0. 
  3717. If the value is less than the first entry (in this case 0.1) then the first 
  3718. color (Red) is used.  Values from 0.1 to 0.3 use a blend of red and yellow 
  3719. using linear interpolation of the two colors.  Similarly values from 0.3 to 0.6 
  3720. blend from yellow to blue. Note that the 3rd and 4th entries both have values 
  3721. of 0.6.  This causes an immediate abrupt shift of color from blue to green. 
  3722. Specifically a value that is less than 0.6 will be blue but exactly equal to 
  3723. 0.6 will be green.  Moving along, values from 0.6 to 0.8 will be a blend of 
  3724. green and cyan.  Finally any value greater than or equal to 0.8 will be cyan. 
  3725.  
  3726. If you want areas of unchanging color you simply specify the same color for two 
  3727. adjacent entries.  For example: 
  3728.  
  3729.         color_map {
  3730.           [0.1  color Red]
  3731.           [0.3  color Yellow]
  3732.           [0.6  color Yellow]
  3733.           [0.8  color Green]
  3734.         }
  3735.  
  3736. In this case any value from 0.3 to 0.6 will be pure yellow. 
  3737.  
  3738.  
  3739. ΓòÉΓòÉΓòÉ 6.4.1.3.3. 5.4.1.3.3  Marble ΓòÉΓòÉΓòÉ
  3740.  
  3741. A "gradient x" pattern uses colors from the color map from 0.0 up to 1.0 at 
  3742. location x=1 but then jumps back to the first color for x=1.00000001 (or some 
  3743. tiny fraction above 1.0) and repeats the pattern again and again.  The marble 
  3744. pattern is similar except that it uses the color map from 0 to 1 but then it 
  3745. reverses the map and blends from 1 back to zero.  For example: 
  3746.  
  3747.         pigment {
  3748.           gradient x
  3749.           color_map {
  3750.             [0.0  color Yellow]
  3751.             [1.0  color Cyan]
  3752.           }
  3753.         }
  3754.  
  3755. This blends from yellow to cyan and then it abruptly changes back to yellow and 
  3756. repeats.  However replacing "gradient x" with "marble" smoothly blends from 
  3757. yellow to cyan as the x coordinate goes from 0.0 to 0.5 and then smoothly 
  3758. blends back from cyan to yellow by x=1.0. 
  3759.  
  3760. When used with a "turbulence" modifier and an appropriate color map, this 
  3761. pattern looks like veins of color of real marble, jade or other types of stone. 
  3762. By default, marble has no turbulence. 
  3763.  
  3764.  
  3765. ΓòÉΓòÉΓòÉ 6.4.1.3.4. 5.4.1.3.4  Wood ΓòÉΓòÉΓòÉ
  3766.  
  3767. Wood uses the color map to create concentric cylindrical bands of color 
  3768. centered on the Z axis.  These bands look like the growth rings and veins in 
  3769. real wood.  Small amounts of turbulence should be added to make it look more 
  3770. realistic. By default, wood has no turbulence. 
  3771.  
  3772. Like marble, wood uses color map values 0 to 1 then repeats the colors in 
  3773. reverse order from 1 to 0. 
  3774.  
  3775.  
  3776. ΓòÉΓòÉΓòÉ 6.4.1.3.5. 5.4.1.3.5  Onion ΓòÉΓòÉΓòÉ
  3777.  
  3778. Onion is a pattern of concentric spheres like the layers of an onion.  It uses 
  3779. colors from a color map from 0 to 1, 0 to 1 etc without reversing. 
  3780.  
  3781.  
  3782. ΓòÉΓòÉΓòÉ 6.4.1.3.6. 5.4.1.3.6  Leopard ΓòÉΓòÉΓòÉ
  3783.  
  3784. Leopard creates regular geometric pattern of circular spots.  It uses colors 
  3785. from a color map from 0 to 1, 0 to 1 etc without reversing. 
  3786.  
  3787.  
  3788. ΓòÉΓòÉΓòÉ 6.4.1.3.7. 5.4.1.3.7  Granite ΓòÉΓòÉΓòÉ
  3789.  
  3790. This pattern uses a simple 1/f fractal noise function to give a pretty darn 
  3791. good granite pattern. Typically used with small scaling values (2.0 to 5.0). 
  3792. This pattern is used with creative color maps in STONES.INC to create some 
  3793. gorgeous layered stone textures. By default, granite has no turbulence.  It 
  3794. uses colors from a color map from 0 to 1, 0 to 1 etc without reversing. 
  3795.  
  3796.  
  3797. ΓòÉΓòÉΓòÉ 6.4.1.3.8. 5.4.1.3.8  Bozo ΓòÉΓòÉΓòÉ
  3798.  
  3799. The bozo color pattern takes a noise function and maps it onto the surface of 
  3800. an object. It uses colors from a color map from 0 to 1, 0 to 1 etc without 
  3801. reversing. 
  3802.  
  3803. Noise in ray tracing is sort of like a random number generator, but it has the 
  3804. following properties: 
  3805.  
  3806.  1. It's defined over 3D space i.e., it takes x, y, and z and returns the noise 
  3807.     value there. 
  3808.  
  3809.  2. If two points are far apart, the noise values at those points are 
  3810.     relatively random. 
  3811.  
  3812.  3. If two points are close together, the noise values at those points are 
  3813.     close to each other. 
  3814.  
  3815. You can visualize this as having a large room and a thermometer that ranges 
  3816. from 0.0 to 1.0. Each point in the room has a temperature. Points that are far 
  3817. apart have relatively random temperatures. Points that are close together have 
  3818. close temperatures. The temperature changes smoothly, but randomly as we move 
  3819. through the room. 
  3820.  
  3821. Now, let's place an object into this room along with an artist. The artist 
  3822. measures the temperature at each point on the object and paints that point a 
  3823. different color depending on the temperature. What do we get? A POV-Ray bozo 
  3824. texture! 
  3825.  
  3826.  
  3827. ΓòÉΓòÉΓòÉ 6.4.1.3.9. 5.4.1.3.9  Spotted ΓòÉΓòÉΓòÉ
  3828.  
  3829. This uses the same noise pattern as bozo but it is unaffected by turbulence. 
  3830. It uses colors from a color map from 0 to 1, 0 to 1 etc without reversing. 
  3831.  
  3832.  
  3833. ΓòÉΓòÉΓòÉ 6.4.1.3.10. 5.4.1.3.10  Agate ΓòÉΓòÉΓòÉ
  3834.  
  3835. This pattern is very beautiful and similar to marble, but uses a different 
  3836. turbulence function. The turbulence keyword has no effect, and as such it is 
  3837. always very turbulent. You may control the amount of the built-in turbulence by 
  3838. adding the "agate_turb" keyword followed by a float value. For example: 
  3839.  
  3840.         pigment {
  3841.           agate
  3842.           agate_turb 0.5
  3843.           color_map {
  3844.             ...
  3845.           }
  3846.         }
  3847.  
  3848.  
  3849. ΓòÉΓòÉΓòÉ 6.4.1.3.11. 5.4.1.3.11  Mandel ΓòÉΓòÉΓòÉ
  3850.  
  3851. The mandel pattern computes the standard Mandelbrot fractal pattern and 
  3852. projects it onto the X-Y plane.  It uses the X and Y coordinates to compute the 
  3853. Mandelbrot set.  The pattern is specified with the keyword mandel followed by 
  3854. an integer number.  This number is the maximum number of iterations to be used 
  3855. to compute the set.  Typical values range from 10 up to 256 but any positive 
  3856. integer may be used.  For example: 
  3857.  
  3858.         sphere {
  3859.           <0, 0, 0>, 1
  3860.           pigment {
  3861.           mandel 25
  3862.           color_map {
  3863.             [0.0  color Cyan]
  3864.             [0.3  color Yellow]
  3865.             [0.6  color Magenta]
  3866.             [1.0  color Cyan]
  3867.            }
  3868.           scale .5
  3869.          }
  3870.         }
  3871.  
  3872. The value passed to the color map is computed by the formula: 
  3873.  
  3874.         value = number_of_iterations / max_iterations
  3875.  
  3876. The color extends infinitely in the Z direction similar to a planar image map. 
  3877.  
  3878.  
  3879. ΓòÉΓòÉΓòÉ 6.4.1.3.12. 5.4.1.3.12  Radial ΓòÉΓòÉΓòÉ
  3880.  
  3881. The radial pattern is a radial blend that wraps around the +Y axis.  The color 
  3882. for value 0.0 starts at the +X direction and wraps the color map around from 
  3883. east to west with 0.25 in the -Z direction, 0.5 in -X, 0.75 at +Z and back to 
  3884. 1.0 at +X.  See the "frequency" and "phase" pigment modifiers below for 
  3885. examples. 
  3886.  
  3887.  
  3888. ΓòÉΓòÉΓòÉ 6.4.1.4. 5.4.1.4  Image Maps ΓòÉΓòÉΓòÉ
  3889.  
  3890. When all else fails and none of the above pigment pattern types meets your 
  3891. needs, you can use an image map to wrap a 2-D bit-mapped image around your 3-D 
  3892. objects. 
  3893.  
  3894.  
  3895. ΓòÉΓòÉΓòÉ 6.4.1.4.1. 5.4.1.4.1  Specifying an image map. ΓòÉΓòÉΓòÉ
  3896.  
  3897. The syntax for image_map is... 
  3898.  
  3899.         pigment {
  3900.           image_map {
  3901.           FILE_TYPE "filename"
  3902.           MODIFIERS...
  3903.           }
  3904.         }
  3905.  
  3906. Where FILE_TYPE is one of the following keywords "gif", "tga", "iff" or "dump". 
  3907. This is followed by the name of the file in quotes.  Several optional modifiers 
  3908. may follow the file specification.  The modifiers are described below. Note: 
  3909. Earlier versions of POV-Ray allowed some modifiers before the FILE_TYPE but 
  3910. that syntax is being phased out in favor of the syntax described here. 
  3911.  
  3912. Filenames specified in the image_map statements will be searched for in the 
  3913. home (current) directory first, and if not found, will then be searched for in 
  3914. directories specified by any "-L" (library path) options active. This would 
  3915. facilitate keeping all your image maps files in a separate subdirectory, and 
  3916. giving an "-L" option on the command line to where your library of image maps 
  3917. are. 
  3918.  
  3919. By default, the image is mapped onto the X-Y plane.  The image is "projected" 
  3920. onto the object as though there were a slide projector somewhere in the -Z 
  3921. direction.  The image exactly fills the square area from x,y coordinates (0,0) 
  3922. to (1,1) regardless of the image's original size in pixels.  If you would like 
  3923. to change this default, you may translate, rotate or scale the pigment or 
  3924. texture to map it onto the object's surface as desired. 
  3925.  
  3926. In the section 5.4.1.2 above when we explained checker pigment patterns, we 
  3927. described the checks as solid cubes of colored clay from which objects are 
  3928. carved.  With image maps you should imagine that each pixel is a long, thin, 
  3929. square, colored rod that extends parallel to the Z axis.  The image is made 
  3930. from rows and columns of these rods bundled together and the object is then 
  3931. carved from the bundle. 
  3932.  
  3933. If you would like to change this default orientation, you may translate, rotate 
  3934. or scale the pigment or texture to map it onto the object's surface as desired. 
  3935.  
  3936.  
  3937. ΓòÉΓòÉΓòÉ 6.4.1.4.2. 5.4.1.4.2  The "once" option. ΓòÉΓòÉΓòÉ
  3938.  
  3939. Normally there are an infinite number of repeating images created over every 
  3940. unit square of the X-Y plane like tiles.  By adding the keyword "once" after a 
  3941. file name, you can eliminate all other copies of the image except the one at 
  3942. (0,0) to (1,1).  Areas outside this unit square are treated as fully 
  3943. transparent. 
  3944.  
  3945. Note: The "once" keyword may also be used with bump_map and material_map 
  3946. statements. 
  3947.  
  3948.  
  3949. ΓòÉΓòÉΓòÉ 6.4.1.4.3. 5.4.1.4.3  The "map_type" option. ΓòÉΓòÉΓòÉ
  3950.  
  3951. The default projection of the image onto the X-Y plane is called a "planar map 
  3952. type".  This option may be changed by adding the "map_type" keyword followed by 
  3953. a number specifying the way to wrap the image around the object. 
  3954.  
  3955. A "map_type 0" gives the default planar mapping already described. 
  3956.  
  3957. A "map_type 1" is a spherical mapping.  It assumes that the object is a sphere 
  3958. of any size sitting at the origin.  The Y axis is the north/south pole of the 
  3959. spherical mapping.  The top and bottom edges of the image just touch the pole 
  3960. regardless of any scaling.  The left edge of the image begins at the positive X 
  3961. axis and wraps the image around the sphere from "west" to "east" in a -Y 
  3962. rotation.  The image covers the sphere exactly once.  The "once" keyword has no 
  3963. meaning for this type. 
  3964.  
  3965. With "map_type 2" you get a cylindrical mapping.  It assumes that a cylinder of 
  3966. any diameter lies along the Y axis.  The image wraps around the cylinder just 
  3967. like the spherical map but the image remains 1 unit tall from y=0 to y=1.  This 
  3968. band of color is repeated at all heights unless the "once" keyword is applied. 
  3969.  
  3970. Finally "map_type 5" is a torus or donut shaped mapping.  It assumes that a 
  3971. torus of major radius 1 sits at the origin in the X-Z plane.  The image is 
  3972. wrapped around similar to spherical or cylindrical maps.  However the top and 
  3973. bottom edges of the map wrap over and under the torus where they meet each 
  3974. other on the inner rim. 
  3975.  
  3976. Types 3 and 4 are still under development. 
  3977.  
  3978. Note: The "map_type" option may also be applied to bump_map and material_map 
  3979. statements. 
  3980.  
  3981.  
  3982. ΓòÉΓòÉΓòÉ 6.4.1.4.4. 5.4.1.4.4  The "filter" options. ΓòÉΓòÉΓòÉ
  3983.  
  3984. To make all or part of an image map transparent, you can specify filter values 
  3985. for the color palette/registers of GIF or IFF pictures (at least for the modes 
  3986. that use palettes/color maps). You can do this by adding the keyword "filter" 
  3987. following the filename.  The keyword is followed by two numbers.  The first 
  3988. number is the palette/register number value and 2nd is the amount of 
  3989. transparency. The values should be separated by a comma.  For example: 
  3990.  
  3991.         image_map {
  3992.           gif "mypic.gif"
  3993.           map_type 0
  3994.           filter 0, 0.5 // Make color 0 50% transparent
  3995.           filter 5, 1.0 // Make color 5 100% transparent
  3996.           filter 8, 0.3 // Make color 8 30% transparent
  3997.         }
  3998.  
  3999. You can give the entire image a filter value using "filter all VALUE".  For 
  4000. example: 
  4001.  
  4002.         image_map {
  4003.           gif "stnglass.gif"
  4004.           map_type 0
  4005.           filter all 0.9
  4006.         }
  4007.  
  4008. NOTE: Transparency works by filtering light by its original color.  Adding 
  4009. "filter" to the color black still leaves you with black no matter how high the 
  4010. filter value is. If you want a color to be clear, add filter 1 to the color 
  4011. white. 
  4012.  
  4013.  
  4014. ΓòÉΓòÉΓòÉ 6.4.1.4.5. 5.4.1.4.5  The "interpolate" option. ΓòÉΓòÉΓòÉ
  4015.  
  4016. Adding the "interpolate" keyword can smooths the jagged look of an image or 
  4017. bump map.  When POV-Ray asks a color or bump amount for an image or bump map, 
  4018. it often asks for a point that is not directly on top of one pixel, but sort of 
  4019. between several different colored pixels.  Interpolations returns an 
  4020. "in-between" value so that the steps between the pixels in the image or bump 
  4021. map will look smoother. 
  4022.  
  4023. There are currently two types of interpolation: 
  4024.  
  4025.         Normalized Distance -- interpolate 4
  4026.         Bilinear            -- interpolate 2
  4027.  
  4028. Default is no interpolation. Normalized distance is the slightly faster of the 
  4029. two, bilinear does a better job of picking the between color. Normally, 
  4030. bilinear is used. 
  4031.  
  4032. If your bump or image map looks jaggy, try using interpolation instead of going 
  4033. to a higher resolution image.  The results can be very good.  For example: 
  4034.  
  4035.         image_map {
  4036.           gif "mypic.gif"
  4037.           map_type 0
  4038.           interpolate 2
  4039.         }
  4040.  
  4041.  
  4042. ΓòÉΓòÉΓòÉ 6.4.1.5. 5.4.1.5  Pigment Modifiers ΓòÉΓòÉΓòÉ
  4043.  
  4044. After specifying the pigment type such as marble, wood etc and adding an 
  4045. optional color map, you may add any of several modifiers. 
  4046.  
  4047.  
  4048. ΓòÉΓòÉΓòÉ 6.4.1.5.1. 5.4.1.5.1  Turbulence ΓòÉΓòÉΓòÉ
  4049.  
  4050. The keyword "turbulence" followed by a float or vector may be used to stir up 
  4051. the color pattern.  Typical values range from the default 0.0 which is no 
  4052. turbulence to 1.0 which is very turbulent.  If a vector is specified then 
  4053. different amounts of turbulence are applied in the x, y and z directions.  For 
  4054. example "turbulence <1.0, 0.6, 0.1>" has much turbulence in the x direction, a 
  4055. moderate amount in the y direction and a small amount in the z direction. 
  4056.  
  4057. Turbulence uses a noise function called DNoise.  This is sort of like noise 
  4058. used in the bozo pattern except that instead of giving a single value it gives 
  4059. a direction. You can think of it as the direction that the wind is blowing at 
  4060. that spot. 
  4061.  
  4062. Turbulence which uses DNoise to push a point around a few times.  We locate the 
  4063. point we want to color (P), then push it around a bit using turbulence to get 
  4064. to a final point (Q) then look up the color of point Q in our ordinary boring 
  4065. textures. That's the color that's used for the point P. 
  4066.  
  4067. It in effect says "Don't give me the color at this spot... take a few random 
  4068. steps in a different direction and give me that color.  Each step is typically 
  4069. half as long as the one before.  For example: 
  4070.  
  4071.          P ------------------------->
  4072.                   First Move        /
  4073.                                    /
  4074.                                   /
  4075.                                  /Second
  4076.                                 /  Move
  4077.                                /
  4078.                         ______/
  4079.                         \
  4080.                          \
  4081.                           Q - Final point.
  4082.  
  4083. The magnitude of these steps is controlled by the turbulence value. 
  4084.  
  4085.  
  4086. ΓòÉΓòÉΓòÉ 6.4.1.5.2. 5.4.1.5.2  Octaves ΓòÉΓòÉΓòÉ
  4087.  
  4088. The number of steps used by turbulence is controlled by the "octaves" value. 
  4089. The values may range from 1 up to 10.  The default value of "octaves 6" is 
  4090. fairly close to the upper limit; you won't see much change by setting it to a 
  4091. higher value because the extra steps are too small.  You can achieve some very 
  4092. interesting wavy effects by specifying lower values. Setting octaves higher can 
  4093. slow down rendering because more steps are computed. 
  4094.  
  4095.  
  4096. ΓòÉΓòÉΓòÉ 6.4.1.5.3. 5.4.1.5.3  Omega ΓòÉΓòÉΓòÉ
  4097.  
  4098. The keyword "omega" followed by a float value may be added to change the 
  4099. turbulence calculations.  Each successive octave of turbulence is multiplied by 
  4100. the omega value. The default "omega 0.5" means that each octave is 1/2 the size 
  4101. of the previous one.  Higher omega values mean that 2nd, 3rd, 4th and up 
  4102. octaves contribute more turbulence giving a sharper, "krinkly" look while 
  4103. smaller omegas give a fuzzy kind of turbulence that gets blury in places. 
  4104.  
  4105.  
  4106. ΓòÉΓòÉΓòÉ 6.4.1.5.4. 5.4.1.5.4  Lambda ΓòÉΓòÉΓòÉ
  4107.  
  4108. The lambda parameter controls how statistically different the random move of an 
  4109. octave is compared to its previous octave.  The default value for this is 
  4110. "lambda 2".  Values close to lambda 1.0 will straighten out the randomness of 
  4111. the path in the diagram above.  Higher values can look more "swirly" under some 
  4112. circumstances.  More tinkering by POV-Ray users may lead us to discover ways to 
  4113. make good use of this parameter.  For now just tinker and enjoy. 
  4114.  
  4115.  
  4116. ΓòÉΓòÉΓòÉ 6.4.1.5.5. 5.4.1.5.5  Quick_color ΓòÉΓòÉΓòÉ
  4117.  
  4118. When developing POV-Ray scenes its often useful to do low quality test runs 
  4119. that render faster.  The +Q command line switch can be used to turn off some 
  4120. time consuming color pattern and lighting calculations to speed things up. 
  4121. However all settings of +Q5 or lower turns off pigment calculations and creates 
  4122. gray objects. 
  4123.  
  4124. By adding a "quick_color" to a pigment you tell POV-Ray what solid color to use 
  4125. for quick renders instead of a patterned pigment.  For example: 
  4126.  
  4127.         pigment {
  4128.           gradient x
  4129.           color_map{
  4130.           [0 color Yellow][0.3 color Cyan][0.6 color Magenta][1 color Cyan]
  4131.          }
  4132.           turbulence 0.5  lambda 1.5  omega 0.75  octaves 8
  4133.           quick_color Neon_Pink
  4134.         }
  4135.  
  4136. This tells POV-Ray to use solid Neon_Pink for test runs at quality +Q5 or lower 
  4137. but to use the turbulent gradient pattern for rendering at +Q6 and higher. 
  4138.  
  4139. Note that solid color pigments such as: 
  4140.  
  4141.         pigment {color Magenta}
  4142.  
  4143. automatically set the quick_color to that value.  You may override this if you 
  4144. want.  Suppose you have 10 spheres on the screen and all are Yellow. If you 
  4145. want to identify them individually you could give each a different quick_color 
  4146. like this: 
  4147.  
  4148.         sphere {<1,2,3>,4 pigment {color Yellow  quick_color Red}}
  4149.  
  4150.         sphere {<-1,-2,-3>,4 pigment {color Yellow  quick_color Blue}}
  4151.  
  4152.  ...and so on.  At +Q6 or higher they will all be Yellow but at +Q5 or lower 
  4153. each would be different colors so you could identify them. 
  4154.  
  4155.  
  4156. ΓòÉΓòÉΓòÉ 6.4.1.5.6. 5.4.1.5.6  Frequency and Phase ΓòÉΓòÉΓòÉ
  4157.  
  4158. The frequency and phase keywords were originally intended for the normal 
  4159. patterns ripples and waves discussed in the next section.  With version 2.0 
  4160. they were extended to pigments to make the radial and mandel pigment pattern 
  4161. easier to use.  As it turned out it was simple to make them apply to any color 
  4162. map pattern. 
  4163.  
  4164. The frequency keyword adjusts the number of times that a color map repeats over 
  4165. one cycle of a pattern.  For example gradient x covers color map values 0 to 1 
  4166. over the range x=0 to x=1.  By adding "frequency 2" the color map repeats twice 
  4167. over that same range.  The same effect can be achieved using "scale x*0.5" so 
  4168. the frequency keyword isn't that useful for patterns like gradient. 
  4169.  
  4170. However the radial pattern wraps the color map around the +Y axis once.  If you 
  4171. wanted two copies of the map (or 3 or 10 or 100) you'd have to build a bigger 
  4172. map.  Adding "frequency 2" causes the color map to be used twice per 
  4173. revolution.  Try this: 
  4174.  
  4175.         sphere {<0,0,0>,3
  4176.           pigment {
  4177.             radial
  4178.             color_map{[0.5 color Red][0.5 color White]}
  4179.             frequency 6
  4180.           }
  4181.           rotate -x*90
  4182.         }
  4183.  
  4184. The result is 6 sets of red and white radial stripes evenly spaced around the 
  4185. sphere. 
  4186.  
  4187. Note "frequency -1" reverses the entries in a color_map. 
  4188.  
  4189. The phase keyword takes values from 0.0 to 1.0 and rotates the color map 
  4190. entries.  In the example above if you render successive frames at phase 0 then 
  4191. phase 0.1, phase 0.2 etc you could create an animation that rotates the 
  4192. stripes.  The same effect can be easily achieved by rotating the radial pigment 
  4193. using "rotate y*Angle" but there are other uses where phase can be handy. 
  4194.  
  4195. Sometimes you create a great looking gradient or wood color map but you want 
  4196. the grain slightly adjusted in or out.  You could re-order the color map 
  4197. entries but that's a pain.  A phase adjustment will shift everything but keep 
  4198. the same scale.  Try animating a mandel pigment for a color palette rotation 
  4199. effect. 
  4200.  
  4201.  
  4202. ΓòÉΓòÉΓòÉ 6.4.1.5.7. 5.4.1.5.7  Transforming pigments ΓòÉΓòÉΓòÉ
  4203.  
  4204. You may modify pigment patterns with "translate", "rotate" and "scale" 
  4205. commands. Note that placing these transforms inside the texture but outside the 
  4206. pigment will transform the entire texture.  However placing them inside the 
  4207. pigment transforms just the pigment. For example: 
  4208.  
  4209.         sphere {<0,0,0>,3
  4210.           texture {
  4211.             pigment {
  4212.               checker color Red color White
  4213.               scale <2,1,3>  // affects pigment only... not normal
  4214.             }
  4215.           normal {
  4216.             bumps 0.3
  4217.             scale 0.4      // affects bump normal only... not pigment
  4218.           }
  4219.           finish {Shiny}
  4220.           translate 5*x    // affects entire texture
  4221.         }
  4222.         translate y*2      // affects object and texture
  4223.         }
  4224.  
  4225. Note that transforms affect the entire pigment regardless of the ordering of 
  4226. other parameters. For example: 
  4227.  
  4228.         This...                         ...is the same as this...
  4229.  
  4230.         pigment {                          pigment {
  4231.           bozo                               bozo
  4232.           turbulence 0.3                     scale 2
  4233.           scale 2                            turbulence 0.3
  4234.         }                                  }
  4235.  
  4236. The scaling before or after turbulence makes no difference.  In general it is 
  4237. best to put all transformations last for the sake of clarity. 
  4238.  
  4239.  
  4240. ΓòÉΓòÉΓòÉ 6.4.2. 5.4.2  Normal ΓòÉΓòÉΓòÉ
  4241.  
  4242. Ray tracing is known for the dramatic way it depicts reflection, refraction and 
  4243. lighting effects.  Much of our perception depends on the reflective properties 
  4244. of an object.  Ray tracing can exploit this by playing tricks on our perception 
  4245. to make us see complex details that aren't really there. 
  4246.  
  4247. Suppose you wanted a very bumpy surface on the object.  It would be very 
  4248. difficult to mathematically model lots of bumps.  We can however simulate the 
  4249. way bumps look by altering the way light reflects off of the surface. 
  4250. Reflection calculations depend on a vector called a "surface normal" vector. 
  4251. This is a vector which points away from the surface and is perpendicular to it. 
  4252. By artificially modifying (or perturbing) this normal vector you can simulate 
  4253. bumps. 
  4254.  
  4255. The "normal {...}" statement is the part of a texture which defines the pattern 
  4256. of normal perturbations to be applied to an object.  Like the pigment 
  4257. statement, you can omit the surrounding texture block to save typing.  Do not 
  4258. forget however that there is a texture implied. For example... 
  4259.  
  4260.         this...                        can be shortened to this...
  4261.  
  4262.         object {                           object {
  4263.           My_Object                          My_Object
  4264.             texture {                          pigment {color Purple}
  4265.               pigment {color Purple}           normal {bumps 0.3}
  4266.               normal {bumps 0.3}             }
  4267.             }
  4268.         }
  4269.  
  4270. Note that attaching a normal pattern does not really modify the surface. It 
  4271. ONLY affects the way light reflects or refracts at the surface so that it LOOKS 
  4272. bumpy. 
  4273.  
  4274. The most complete form for defining a normal is as follows: 
  4275.  
  4276.         normal {
  4277.           NORMAL_IDENTIFIER
  4278.           NORMAL_PATTERN_TYPE
  4279.           NORMAL_MODIFIERS
  4280.           TRANSFORMATIONS...
  4281.         }
  4282.  
  4283. Each of the items in a normal are optional but if they are present, they should 
  4284. be in the order shown above to insure that the results are as expected.  Any 
  4285. items after the NORMAL_IDENTIFIER modify or override settings given in the 
  4286. IDENTIFIER.  If no identifier is specified then the items modify the normal 
  4287. values in the current default texture. TRANSFORMATIONs are translate, rotate 
  4288. and scale statements.  They apply only to the normal and not to other parts of 
  4289. the texture.  They should be specified last. 
  4290.  
  4291. There are 6 different NORMAL_PATTERN_TYPEs discussed below.  They are bumps, 
  4292. dents, ripples, waves, wrinkles and bump_map. 
  4293.  
  4294.  
  4295. ΓòÉΓòÉΓòÉ 6.4.2.1. 5.4.2.1  Bumps ΓòÉΓòÉΓòÉ
  4296.  
  4297. A smoothly rolling random pattern of bumps can be created with the "bumps" 
  4298. normal pattern.  Bumps uses the same random noise function as the bozo and 
  4299. spotted pigment patterns, but uses the derived value to perturb the surface 
  4300. normal or, in other words, make the surface look bumpy. This gives the 
  4301. impression of a "bumpy" surface, random and irregular, sort of like an orange. 
  4302.  
  4303. After the bumps keyword, you supply a single floating point value for the 
  4304. amount of surface perturbation.  Values typically range from 0.0 (No Bumps) to 
  4305. 1.0 or greater (Extremely Bumpy). For example: 
  4306.  
  4307.         sphere {
  4308.           <0, 1, 2>, 2
  4309.           texture {
  4310.             pigment {color Yellow}
  4311.             normal {bumps 0.4   scale 0.2}
  4312.             finish {phong 1}
  4313.            }
  4314.         }
  4315.  
  4316. This tells POV-Ray to use a bump pattern to modify the surface normal.  The 
  4317. value 0.4 controls the apparent depth of the bumps.  Usually the bumps are 
  4318. about 1 unit wide which doesn't work very well with a sphere of radius 2. The 
  4319. scale makes the bumps 1/5th as wide but does not affect their depth. 
  4320.  
  4321.  
  4322. ΓòÉΓòÉΓòÉ 6.4.2.2. 5.4.2.2  Dents ΓòÉΓòÉΓòÉ
  4323.  
  4324. The "dents" pattern is especially interesting when used with metallic textures, 
  4325. it gives impressions into the metal surface that look like dents have been 
  4326. beaten into the surface with a hammer. A single value is supplied after the 
  4327. dents keyword to indicate the amount of denting required. Values range from 0.0 
  4328. (Showroom New) to 1.0 (Insurance Wreck). Scale the pattern to make the pitting 
  4329. more or less frequent. 
  4330.  
  4331.  
  4332. ΓòÉΓòÉΓòÉ 6.4.2.3. 5.4.2.3  Ripples ΓòÉΓòÉΓòÉ
  4333.  
  4334. The ripples bump pattern make a surface look like ripples of water. The ripples 
  4335. option requires a value to determine how deep the ripples are. Values range 
  4336. from 0.0 to 1.0 or more.  The ripples radiate from 10 random locations inside 
  4337. the unit cube area <0,0,0> to <1,1,1>.  Scale the pattern to make the centers 
  4338. closer or farther apart. 
  4339.  
  4340. The frequency keyword changes the spacing between ripples.  The phase keyword 
  4341. can be used to move the ripples outwards for realistic animation. 
  4342.  
  4343.  
  4344. ΓòÉΓòÉΓòÉ 6.4.2.4. 5.4.2.4  Waves ΓòÉΓòÉΓòÉ
  4345.  
  4346. This works in a similar way to ripples except that it makes waves with 
  4347. different frequencies. The effect is to make waves that look more like deep 
  4348. ocean waves.  The waves option requires a value to determine how deep the waves 
  4349. are.  Values range from 0.0 to 1.0 or more.  The waves radiate from 10 random 
  4350. locations inside the unit cube area <0,0,0> to <1,1,1>.  Scale the pattern to 
  4351. make the centers closer or farther apart. 
  4352.  
  4353. The frequency keyword changes the spacing between waves.  The phase keyword can 
  4354. be used to move the waves outwards for realistic animation. 
  4355.  
  4356.  
  4357. ΓòÉΓòÉΓòÉ 6.4.2.5. 5.4.2.5  Wrinkles ΓòÉΓòÉΓòÉ
  4358.  
  4359. This is sort of a 3-D bumpy granite. It uses a similar 1/f fractal noise 
  4360. function to perturb the surface normal in 3-D space. With a transparent color 
  4361. pattern, could look like wrinkled cellophane. Requires a single value after the 
  4362. wrinkles keyword to indicate the amount of wrinkling desired. Values from 0.0 
  4363. (No Wrinkles) to 1.0 (Very Wrinkled) are typical. 
  4364.  
  4365.  
  4366. ΓòÉΓòÉΓòÉ 6.4.2.6. 5.4.2.6  Bump_map ΓòÉΓòÉΓòÉ
  4367.  
  4368. When all else fails and none of the above normal pattern types meets your 
  4369. needs, you can use a bump map to wrap a 2-D bit-mapped bump pattern around your 
  4370. 3-D objects. 
  4371.  
  4372. Instead of placing the color of the image on the shape like an image_map, 
  4373. bump_map perturbs the surface normal based on the color of the image at that 
  4374. point. The result looks like the image has been embossed into the surface.  By 
  4375. default, bump_map uses the brightness of the actual color of the pixel. Colors 
  4376. are converted to gray scale internally before calculating height.  Black is a 
  4377. low spot, white is a high spot. The image's index values may be used instead 
  4378. (see use_index) below. 
  4379.  
  4380.  
  4381. ΓòÉΓòÉΓòÉ 6.4.2.6.1. 5.4.2.6.1  Specifying a bump map. ΓòÉΓòÉΓòÉ
  4382.  
  4383. The syntax for bump_map is... 
  4384.  
  4385.         normal {
  4386.           bump_map {
  4387.             FILE_TYPE "filename"
  4388.             MODIFIERS...
  4389.           }
  4390.         }
  4391.  
  4392. Where FILE_TYPE is one of the following keywords "gif", "tga", "iff" or "dump". 
  4393. This is followed by the name of the file in quotes.  Several optional modifiers 
  4394. may follow the file specification.  The modifiers are described below. Note: 
  4395. Earlier versions of POV-Ray allowed some modifiers before the FILE_TYPE but 
  4396. that syntax is being phased out in favor of the syntax described here. 
  4397.  
  4398. Filenames specified in the bump_map statements will be searched for in the home 
  4399. (current) directory first, and if not found, will then be searched for in 
  4400. directories specified by any "-L" (library path) options active. This would 
  4401. facilitate keeping all your bump maps files in a separate subdirectory, and 
  4402. giving an "-L" option on the command line to where your library of bump maps 
  4403. are. 
  4404.  
  4405. By default, the bump is mapped onto the X-Y plane.  The bump is "projected" 
  4406. onto the object as though there were a slide projector somewhere in the -Z 
  4407. direction.  The bump exactly fills the square area from x,y coordinates (0,0) 
  4408. to (1,1) regardless of the bump's original size in pixels.  If you would like 
  4409. to change this default, you may translate, rotate or scale the normal or 
  4410. texture to map it onto the object's surface as desired. 
  4411.  
  4412. If you would like to change this default orientation, you may translate, rotate 
  4413. or scale the normal or texture to map it onto the object's surface as desired. 
  4414.  
  4415.  
  4416. ΓòÉΓòÉΓòÉ 6.4.2.6.2. 5.4.2.6.2  Bump_size ΓòÉΓòÉΓòÉ
  4417.  
  4418. The relative bump_size can be scaled using bump_size modifier. The bump_size 
  4419. number can be any number other than 0. Valid numbers are 2, .5, -33, 1000, etc. 
  4420. For example: 
  4421.  
  4422.         normal {
  4423.           bump_map {
  4424.             gif "stuff.gif"
  4425.             bump_size 5
  4426.           }
  4427.         }
  4428.  
  4429.  
  4430. ΓòÉΓòÉΓòÉ 6.4.2.6.3. 5.4.2.6.3  Use_index & use_color ΓòÉΓòÉΓòÉ
  4431.  
  4432. Usually the bump_map converts the color of the pixel in the map to a grayscale 
  4433. intensity value in the range 0.0 to 1.0 and calculates the bumps based on that 
  4434. value.  If you specify use_index, bump_map uses the color's palette number to 
  4435. compute as the height of the bump at that point. So, color #0 would be low and 
  4436. color #255 would be high. The actual color of the pixels doesn't matter when 
  4437. using the index.  The "use_color" keyword may be specified to explicitly note 
  4438. that the color methods should be used instead. 
  4439.  
  4440.  
  4441. ΓòÉΓòÉΓòÉ 6.4.2.6.4. 5.4.2.6.4  The "once" option. ΓòÉΓòÉΓòÉ
  4442.  
  4443. Normally there are an infinite number of repeating bump_maps created over every 
  4444. unit square of the X-Y plane like tiles.  By adding the keyword "once" after a 
  4445. file name, you can eliminate all other copies of the bump_map except the one at 
  4446. (0,0) to (1,1).  Areas outside this unit square are treated as fully 
  4447. transparent. 
  4448.  
  4449. Note: The "once" keyword may also be used with image_map and material_map 
  4450. statements. 
  4451.  
  4452.  
  4453. ΓòÉΓòÉΓòÉ 6.4.2.6.5. 5.4.2.6.5  The "map_type" option. ΓòÉΓòÉΓòÉ
  4454.  
  4455. The default projection of the bump onto the X-Y plane is called a "planar map 
  4456. type".  This option may be changed by adding the "map_type" keyword followed by 
  4457. a number specifying the way to wrap the bump around the object. 
  4458.  
  4459. A "map_type 0" gives the default planar mapping already described. 
  4460.  
  4461. A "map_type 1" is a spherical mapping.  It assumes that the object is a sphere 
  4462. of any size sitting at the origin.  The Y axis is the north/south pole of the 
  4463. spherical mapping.  The top and bottom edges of the bump_map just touch the 
  4464. pole regardless of any scaling.  The left edge of the bump_map begins at the 
  4465. positive X axis and wraps the pattern around the sphere from "west" to "east" 
  4466. in a -Y rotation.  The pattern covers the sphere exactly once.  The "once" 
  4467. keyword has no meaning for this type. 
  4468.  
  4469. With "map_type 2" you get a cylindrical mapping.  It assumes that a cylinder of 
  4470. any diameter lies along the Y axis.  The bump pattern wraps around the cylinder 
  4471. just like the spherical map but remains 1 unit tall from y=0 to y=1.  This band 
  4472. of bumps is repeated at all heights unless the "once" keyword is applied. 
  4473.  
  4474. Finally "map_type 5" is a torus or donut shaped mapping.  It assumes that a 
  4475. torus of major radius 1 sits at the origin in the X-Z plane.  The bump pattern 
  4476. is wrapped around similar to spherical or cylindrical maps. However the top and 
  4477. bottom edges of the map wrap over and under the torus where they meet each 
  4478. other on the inner rim. 
  4479.  
  4480. Types 3 and 4 are still under development. 
  4481.  
  4482. Note: The "map_type" option may also be applied to image_map and material_map 
  4483. statements. 
  4484.  
  4485.  
  4486. ΓòÉΓòÉΓòÉ 6.4.2.6.6. 5.4.2.6.6  The "interpolate" option. ΓòÉΓòÉΓòÉ
  4487.  
  4488. Adding the "interpolate" keyword can smooths the jagged look of a bump map. 
  4489. When POV-Ray asks bump amount for a bump map, it often asks for a point that is 
  4490. not directly on top of one pixel, but sort of between several different colored 
  4491. pixels.  Interpolations returns an "in-between" value so that the steps between 
  4492. the pixels in the bump map will look smoother. 
  4493.  
  4494. There are currently two types of interpolation: 
  4495.  
  4496.         Normalized Distance -- interpolate 4
  4497.         Bilinear            -- interpolate 2
  4498.  
  4499. Default is no interpolation. Normalized distance is the slightly faster of the 
  4500. two, bilinear does a better job of picking the between color. Normally, 
  4501. bilinear is used. 
  4502.  
  4503. If your bump map looks jaggy, try using interpolation instead of going to a 
  4504. higher resolution image.  The results can be very good. 
  4505.  
  4506.  
  4507. ΓòÉΓòÉΓòÉ 6.4.2.7. 5.4.2.7  Normal Modifiers ΓòÉΓòÉΓòÉ
  4508.  
  4509. After specifying the normal type such as bumps, dents etc you may add any of 
  4510. several modifiers. 
  4511.  
  4512.  
  4513. ΓòÉΓòÉΓòÉ 6.4.2.7.1. 5.4.2.7.1  Turbulence ΓòÉΓòÉΓòÉ
  4514.  
  4515. The keyword "turbulence" followed by a float or vector may be used to stir up 
  4516. the color pattern.  Typical values range from the default 0.0 which is no 
  4517. turbulence to 1.0 which is very turbulent.  If a vector is specified then 
  4518. different amounts of turbulence is applied in the x, y and z directions.  For 
  4519. example "turbulence <1.0, 0.6, 0.1>" has much turbulence in the x direction, a 
  4520. moderate amount in the y direction and a small amount in the z direction. 
  4521.  
  4522. A complete discussion of turbulence is given under Pigment Modifiers in section 
  4523. 5.4.1.5 above.  The "octaves", "omega", and "lambda" options are also available 
  4524. as normal modifiers.  They discussed under that section as well. 
  4525.  
  4526.  
  4527. ΓòÉΓòÉΓòÉ 6.4.2.7.2. 5.4.2.7.2  Frequency and Phase ΓòÉΓòÉΓòÉ
  4528.  
  4529. Both waves and ripples respond to a parameter called phase. The phase option 
  4530. allows you to create animations in which the water seems to move. This is done 
  4531. by making the phase increment slowly between frames. The range from 0.0 to 1.0 
  4532. gives one complete cycle of a wave. 
  4533.  
  4534. The waves and ripples textures also respond to a parameter called frequency. If 
  4535. you increase the frequency of the waves, they get closer together. If you 
  4536. decrease it, they get farther apart. 
  4537.  
  4538. Bumps, dents, wrinkles and bump_map do not respond to frequency or phase. 
  4539.  
  4540.  
  4541. ΓòÉΓòÉΓòÉ 6.4.2.7.3. 5.4.2.7.3  Transforming normals ΓòÉΓòÉΓòÉ
  4542.  
  4543. You may modify normal patterns with "translate", "rotate" and "scale" commands. 
  4544. Note that placing these transforms inside the texture but outside the normal 
  4545. will transform the entire texture.  However placing them inside the normal 
  4546. transforms just the normal. 
  4547.  
  4548. See section 5.4.1.5.7 Transforming Pigments for examples 
  4549.  
  4550.  
  4551. ΓòÉΓòÉΓòÉ 6.4.3. 5.4.3  Finish ΓòÉΓòÉΓòÉ
  4552.  
  4553. The finish properties of a surface can greatly affect its appearance.  How does 
  4554. light reflect?  What happens when light passes through?  What kind of 
  4555. highlights are visible.  To answer these questions you need a finish statement. 
  4556.  
  4557. The "finish {...}" statement is the part of a texture which defines the various 
  4558. finish properties to be applied to an object.  Like the pigment or normal 
  4559. statement, you can omit the surrounding texture block to save typing.  Do not 
  4560. forget however that there is a texture implied. For example... 
  4561.  
  4562.         this...                        can be shortened to this...
  4563.  
  4564.         object {                           object {
  4565.           My_Object                          My_Object
  4566.           texture {                          pigment {color Purple}
  4567.             pigment {color Purple}           finish {phong 0.3}
  4568.             finish {phong 0.3}             }
  4569.           }
  4570.         }
  4571.  
  4572. The most complete form for defining a finish is as follows: 
  4573.  
  4574.         finish {
  4575.           FINISH_IDENTIFIER
  4576.           FINISH_ITEMS...
  4577.         }
  4578.  
  4579. The FINISH_IDENTIFIER is optional but should proceed all other items.  Any 
  4580. items after the FINISH_IDENTIFIER modify or override settings given in the 
  4581. IDENTIFIER.  If no identifier is specified then the items modify the finish 
  4582. values in the current default texture. Note that transformations are not 
  4583. allowed inside a finish because finish items cover the entire surface 
  4584. uniformly. 
  4585.  
  4586.  
  4587. ΓòÉΓòÉΓòÉ 6.4.3.1. 5.4.3.1  Diffuse Reflection Items ΓòÉΓòÉΓòÉ
  4588.  
  4589. When light reflects off of a surface, the laws of physics say that it should 
  4590. leave the surface at the exact same angle it came in.  This is similar to the 
  4591. way a billiard ball bounces off a bumper of a pool table. This perfect 
  4592. reflection is called "specular" reflection.  However only very smooth polished 
  4593. surfaces reflect light in this way.  Most of the time, light reflects and is 
  4594. scattered in all directions by the roughness of the surface.  This scattering 
  4595. is called "diffuse reflection" because the light diffuses or spreads in a 
  4596. variety of directions.  It accounts for the majority of the reflected light we 
  4597. see. 
  4598.  
  4599. In the real world, light may come from any of three possible sources.  1)It can 
  4600. come directly from actual light sources which are illuminating an object.  2)It 
  4601. can bounce from other objects such as mirrors via specular reflection.  For 
  4602. example shine a flashlight onto a mirror.  3)It can bounce from other objects 
  4603. via diffuse reflections. Look at some dark area under a desk or in a corner. 
  4604. Even though a lamp may not directly illuminate that spot you can still see a 
  4605. little bit because light comes from diffuse reflection off of nearby objects. 
  4606.  
  4607.  
  4608. ΓòÉΓòÉΓòÉ 6.4.3.1.1. 5.4.3.1.1  Diffuse ΓòÉΓòÉΓòÉ
  4609.  
  4610. POV-Ray and most other ray tracers can only simulate directly, one of these 
  4611. three types of illumination.  That is the light which comes directly from the 
  4612. light source which diffuses in all directions.  The keyword "diffuse" is used 
  4613. in a finish statement to control how much light of this direct light is 
  4614. reflected via diffuse reflection.  For example: 
  4615.  
  4616.         finish {diffuse 0.7}
  4617.  
  4618. means that 70% of the light seen comes from direct illumination from light 
  4619. sources.  The default value is diffuse 0.6. 
  4620.  
  4621.  
  4622. ΓòÉΓòÉΓòÉ 6.4.3.1.2. 5.4.3.1.2  Brilliance ΓòÉΓòÉΓòÉ
  4623.  
  4624. The amount of direct light that diffuses from an object depends upon the angle 
  4625. at which it hits the surface.  When light hits at a shallow angle it 
  4626. illuminates less.  When it is directly above a surface it illuminates more. The 
  4627. "brilliance" keyword can be used in a finish statement to vary the way light 
  4628. falls off depending upon the angle of incidence.  This controls the tightness 
  4629. of the basic diffuse illumination on objects and slightly adjusts the 
  4630. appearance of surface shininess.  Objects may appear more metallic by 
  4631. increasing their brilliance. The default value is 1.0. Higher values from 3.0 
  4632. to about 10.0 cause the light to fall off less at medium to low angles. There 
  4633. are no limits to the brilliance value. Experiment to see what works best for a 
  4634. particular situation. This is best used in concert with highlighting. 
  4635.  
  4636.  
  4637. ΓòÉΓòÉΓòÉ 6.4.3.1.3. 5.4.3.1.3  Crand Graininess ΓòÉΓòÉΓòÉ
  4638.  
  4639. Very rough surfaces, such as concrete or sand, exhibit a dark graininess in 
  4640. their apparent color.  This is caused by the shadows of the pits or holes in 
  4641. the surface.  The "crand" keyword can be added to cause a minor random 
  4642. darkening the diffuse reflection of direct illumination.  Typical values range 
  4643. from "crand 0.01" to "crand 0.5" or higher.  The default value is 0. For 
  4644. example: 
  4645.  
  4646.         finish {crand 0.05}
  4647.  
  4648. The grain or noise introduced by this feature is applied on a pixel-by- pixel 
  4649. basis.  This means that it will look the same on far away objects as on close 
  4650. objects.  The effect also looks different depending upon the resolution you are 
  4651. using for the rendering.  For these reasons it is not a very accurate way to 
  4652. model the rough surface effect, but some objects still look better with a 
  4653. little crand thrown in. 
  4654.  
  4655. In previous versions of POV-Ray there was no "crand" keyword.  Any lone float 
  4656. value found inside a texture{...} which was not preceded by a keyword was 
  4657. interpreted as a randomness value. 
  4658.  
  4659. NOTE: This should not be used when rendering animations.  This is the one of a 
  4660. few truly random features in POV-Ray, and will produce an annoying flicker of 
  4661. flying pixels on any textures animated with a "crand" value. 
  4662.  
  4663.  
  4664. ΓòÉΓòÉΓòÉ 6.4.3.1.4. 5.4.3.1.4  Ambient ΓòÉΓòÉΓòÉ
  4665.  
  4666. The light you see in dark shadowed areas comes from diffuse reflection off of 
  4667. other objects.  This light cannot be directly modeled using ray tracing. 
  4668. However we can use a trick called "ambient lighting" to simulate the light 
  4669. inside a shadowed area. 
  4670.  
  4671. Ambient light is light that is scattered everywhere in the room. It bounces all 
  4672. over the place and manages to light objects up a bit even where no light is 
  4673. directly shining.  Computing real ambient light would take far too much time, 
  4674. so we simulate ambient light by adding a small amount of white light to each 
  4675. texture whether or not a light is actually shining on that texture. 
  4676.  
  4677. This means that the portions of a shape that are completely in shadow will 
  4678. still have a little bit of their surface color. It's almost as if the texture 
  4679. glows, though the ambient light in a texture only affects the shape it is used 
  4680. on. 
  4681.  
  4682. The default value is very little ambient light (0.1). The value can range from 
  4683. 0.0 to 1.0.  Ambient light affects both shadowed and non-shadowed areas so if 
  4684. you turn up the ambient value you may want to turn down the diffuse value. 
  4685.  
  4686. Note that this method doesn't account for the color of surrounding objects. If 
  4687. you walk into a room that has red walls, floor and ceiling then your white 
  4688. clothing will look pink from the reflected light.  POV-Ray's ambient shortcut 
  4689. doesn't account for this.  There is also no way to model specular reflected 
  4690. indirect illumination such as the flashlight shining in a mirror. 
  4691.  
  4692.  
  4693. ΓòÉΓòÉΓòÉ 6.4.3.2. 5.4.3.2  Specular Reflection Items ΓòÉΓòÉΓòÉ
  4694.  
  4695. When light does not diffuse and it DOES reflect at the same angle as it hits an 
  4696. object, it is called "specular reflection".  Such mirror-like reflection is 
  4697. controlled by the "reflection" keyword in a finish statement. For example: 
  4698.  
  4699.         finish {reflection 1.0  ambient 0  diffuse 0}
  4700.  
  4701. This gives the object a mirrored finish. It will reflect all other elements in 
  4702. the scene.  The value can range from 0.0 to 1.0. By default there is no 
  4703. reflection. 
  4704.  
  4705. Adding reflection to a texture makes it take longer to render because an 
  4706. additional ray must be traced. 
  4707.  
  4708. NOTE: Although such reflection is called "specular" it is not controlled by the 
  4709. POV-Ray "specular" keyword.  That keyword controls a "specular" highlight. 
  4710.  
  4711.  
  4712. ΓòÉΓòÉΓòÉ 6.4.3.3. 5.4.3.3  Highlights ΓòÉΓòÉΓòÉ
  4713.  
  4714. A highlights are the bright spots that appear when a light source reflects off 
  4715. of a smooth object.  They are a blend of specular reflection and diffuse 
  4716. reflection.  They are specular-like because they depend upon viewing angle and 
  4717. illumination angle.  However they are diffuse-like because some scattering 
  4718. occurs.  In order to exactly model a highlight you would have to calculate 
  4719. specular reflection off of thousands of microscopic bumps called micro facets. 
  4720. The more that micro facets are facing the viewer, the shinier the object 
  4721. appears, and the tighter the highlights become. POV-Ray uses two different 
  4722. models to simulate highlights without calculating micro facets.  They are the 
  4723. specular and phong models. 
  4724.  
  4725. Note that specular and phong highlights are NOT mutually exclusive. It is 
  4726. possible to specify both and they will both take effect. Normally, however, you 
  4727. will only specify one or the other. 
  4728.  
  4729.  
  4730. ΓòÉΓòÉΓòÉ 6.4.3.3.1. 5.4.3.3.1  Phong Highlights ΓòÉΓòÉΓòÉ
  4731.  
  4732. The "phong" keyword controls the amount of Phong highlighting on the object. 
  4733. It causes bright shiny spots on the object that are the color of the light 
  4734. source being reflected. 
  4735.  
  4736. The Phong method measures the average of the facets facing in the mirror 
  4737. direction from the light sources to the viewer. 
  4738.  
  4739. Phong's value is typically from 0.0 to 1.0, where 1.0 causes complete 
  4740. saturation to the light source's color at the brightest area (center) of the 
  4741. highlight. The default phong 0.0 gives no highlight. 
  4742.  
  4743. The size of the highlight spot is defined by the phong_size value.  The larger 
  4744. the phong_size, the tighter, or smaller, the highlight and the shinier the 
  4745. appearance. The smaller the phong_size, the looser, or larger, the highlight 
  4746. and the less glossy the appearance. 
  4747.  
  4748. Typical values range from 1.0 (Very Dull) to 250 (Highly Polished) though any 
  4749. values may be used. Default phong_size is 40 (plastic) if phong_size is not 
  4750. specified.  For example: 
  4751.  
  4752.         finish {phong 0.9  phong_size 60}
  4753.  
  4754. If "phong" is not specified then "phong_size" has no effect. 
  4755.  
  4756.  
  4757. ΓòÉΓòÉΓòÉ 6.4.3.3.2. 5.4.3.3.2  Specular Highlight ΓòÉΓòÉΓòÉ
  4758.  
  4759. A specular highlight is very similar to Phong highlighting, but uses slightly 
  4760. different model.  The specular model more closely resembles real specular 
  4761. reflection and provides a more credible spreading of the highlights occur near 
  4762. the object horizons. 
  4763.  
  4764. Specular's value is typically from 0.0 to 1.0, where 1.0 causes complete 
  4765. saturation to the light source's color at the brightest area (center) of the 
  4766. highlight. The default specular 0.0 gives no highlight. 
  4767.  
  4768. The size of the spot is defined by the value given for roughness.  Typical 
  4769. values range from 1.0 (Very Rough -- large highlight) to 0.0005 (Very Smooth -- 
  4770. small highlight). The default value, if roughness is not specified, is 0.05 
  4771. (Plastic). 
  4772.  
  4773. It is possible to specify "wrong" values for roughness that will generate an 
  4774. error when you try to render the file. Don't use 0 and if you get errors, check 
  4775. to see if you are using a very, very small roughness value that may be causing 
  4776. the error.  For example: 
  4777.  
  4778.         finish {specular 0.9  roughness 0.02}
  4779.  
  4780. If "specular" is not specified then "roughness" has no effect. 
  4781.  
  4782.  
  4783. ΓòÉΓòÉΓòÉ 6.4.3.3.3. 5.4.3.3.3  Metallic Highlight Modifier ΓòÉΓòÉΓòÉ
  4784.  
  4785. The keyword "metallic" may be used with phong or specular highlights.  This 
  4786. keyword indicates that the color of the highlights will be filtered by the 
  4787. surface color instead of directly using the light_source color. Note that the 
  4788. keyword has no numeric value after it.  You either have it or you don't. For 
  4789. example: 
  4790.  
  4791.         finish {phong 0.9  phong_size 60  metallic}
  4792.  
  4793. If "phong" or "specular" is not specified then "metallic" has no effect. 
  4794.  
  4795.  
  4796. ΓòÉΓòÉΓòÉ 6.4.3.4. 5.4.3.4  Refraction ΓòÉΓòÉΓòÉ
  4797.  
  4798. When light passes through a surface either into or out of a dense medium, the 
  4799. path of the ray of light is bent.  Such bending is called refraction. Normally 
  4800. transparent or semi-transparent surfaces in POV-Ray do not refract light. 
  4801. Adding "refraction 1.0" to the finish statement turns on refraction. 
  4802.  
  4803. Note: It is recommended that you only use "refraction 0" or "refraction 1". 
  4804. Values in between will darken the refracted light in ways that do not 
  4805. correspond to any physical property.  Many POV-Ray scenes were created with 
  4806. intermediate refraction values before this "bug" was discovered so the 
  4807. "feature" has been maintained.  A more appropriate way to reduce the brightness 
  4808. of refracted light is to change the "filter" value in the colors specified in 
  4809. the pigment statement. Note also that "refraction" does not cause the object to 
  4810. be transparent. Transparency is only occurs if there is a non-zero "filter" 
  4811. value in the color. 
  4812.  
  4813. The amount of bending or refracting of light depends upon the density of the 
  4814. material.  Air, water, crystal, diamonds all have different density and thus 
  4815. refract differently.  The "index of refraction" or "ior" value is used by 
  4816. scientists to describe the relative density of substances.  The "ior" keyword 
  4817. is used in POV-Ray to specify the value.  For example: 
  4818.  
  4819.         texture {
  4820.           pigment { White filter 0.9 }
  4821.           finish {
  4822.             refraction 1
  4823.             ior 1.5
  4824.           }
  4825.         }
  4826.  
  4827. The default ior value of 1.0 will give no refraction.  The index of refraction 
  4828. for air is 1.0, water is 1.33, glass is 1.5, and diamond is 2.4. The file 
  4829. IOR.INC pre-defines several useful values for ior. 
  4830.  
  4831. NOTE: If a texture has a filter component and no value for refraction and ior 
  4832. are supplied, the renderer will simply transmit the ray through the surface 
  4833. with no bending.  In layered textures, the refraction and ior keywords MUST be 
  4834. in the last texture, otherwise they will not take effect. 
  4835.  
  4836.  
  4837. ΓòÉΓòÉΓòÉ 6.4.4. 5.4.4  Special Textures ΓòÉΓòÉΓòÉ
  4838.  
  4839. Most textures consist of a single pigment, normal and finish specification 
  4840. which applies to the entire surface.  However two special textures have been 
  4841. implemented that extend the "checker" and "image_map" concepts to cover not 
  4842. just pigment but the entire texture. 
  4843.  
  4844.  
  4845. ΓòÉΓòÉΓòÉ 6.4.4.1. 5.4.4.1  Tiles ΓòÉΓòÉΓòÉ
  4846.  
  4847. This first special texture is the "tiles" texture.  It works just like the 
  4848. "checker" pigment pattern except it colors the blocks with entire textures 
  4849. rather than solid colors. 
  4850.  
  4851. The syntax is: 
  4852.  
  4853.         texture{
  4854.           tiles {
  4855.             texture {... put in a texture here ... }
  4856.           tile2
  4857.             texture {... this is the second tile texture }
  4858.           }
  4859.             // Optionally put translate, rotate or scale here
  4860.         }
  4861.  
  4862. For example: 
  4863.  
  4864.         texture{
  4865.           tiles {
  4866.             texture { Jade }
  4867.           tile2
  4868.             texture { Red_Marble }
  4869.           }
  4870.         }
  4871.  
  4872. The textures used in each tile may be any type of texture including more tiles 
  4873. or regular textures made from pigment, normal and finish statements. Note that 
  4874. no other pigment, normal or finish statements may be added to the texture. This 
  4875. is illegal: 
  4876.  
  4877.         texture {
  4878.           tiles {
  4879.             texture {T1}
  4880.           tile2
  4881.             texture {T2}
  4882.           }
  4883.           finish {phong 1.0}
  4884.         }
  4885.  
  4886. The finish must be individually added to each texture. 
  4887.  
  4888. Note that earlier versions of POV-Ray used only the pigment parts of the 
  4889. textures in the tiles.  Normals and finish were ignored.  Also layered textures 
  4890. were not supported.  In order to correct these problems the above restrictions 
  4891. on syntax were necessary.  This means some POV-Ray 1.0 scenes using tiles many 
  4892. need minor modifications that cannot be done automatically with the version 
  4893. compatibility mode. 
  4894.  
  4895. The textures within a tiles texture may be layered but tiles textures do don't 
  4896. work as part of a layered texture. 
  4897.  
  4898.  
  4899. ΓòÉΓòÉΓòÉ 6.4.4.2. 5.4.4.2  Material_Map ΓòÉΓòÉΓòÉ
  4900.  
  4901. The "material_map" special texture extends the concept of "image_map" to apply 
  4902. to entire textures rather than solid colors.  A material_map allows you to wrap 
  4903. a 2-D bit-mapped texture pattern around your 3-D objects. 
  4904.  
  4905. Instead of placing a solid color of the image on the shape like an image_map, 
  4906. an entire texture is specified based on the index or color of the image at that 
  4907. point.  You must specify a list of textures to be used like a "texture palette" 
  4908. rather than the usual color palette. 
  4909.  
  4910. When used with mapped file types such as GIF, the index of the pixel is used as 
  4911. an index into the list of textures you supply.  For unmapped file types such as 
  4912. TGA, the 8 bit value of the red component in the range 0-255 is used as an 
  4913. index. 
  4914.  
  4915. If the index of a pixel is greater than the number of textures in your list 
  4916. then the index is taken modulo N where N is the length of your list of 
  4917. textures. 
  4918.  
  4919.  
  4920. ΓòÉΓòÉΓòÉ 6.4.4.2.1. 5.4.4.2.1  Specifying a material map. ΓòÉΓòÉΓòÉ
  4921.  
  4922. The syntax for material_map is... 
  4923.  
  4924.         texture {
  4925.           material_map {
  4926.             FILE_TYPE "filename"
  4927.             MODIFIERS...
  4928.             texture {...} // First used for index 0
  4929.             texture {...} // Second texture used for index 1
  4930.             texture {...} // Third texture used for index 2
  4931.             texture {...} // Fourth texture used for index 3
  4932.                           // and so on for however many used.
  4933.           }
  4934.           TRANSFORMATION...
  4935.         }
  4936.  
  4937. If particular index values are not used in an image then it may be necessary to 
  4938. supply dummy textures.  It may be necessary to use a paint program or other 
  4939. utility to examine the map file's palette to determine how to arrange the 
  4940. texture list. 
  4941.  
  4942. In the syntax above, FILE_TYPE is one of the following keywords "gif", "tga", 
  4943. "iff" or "dump".  This is followed by the name of the file in quotes.  Several 
  4944. optional modifiers may follow the file specification.  The modifiers are 
  4945. described below. Note: Earlier versions of POV-Ray allowed some modifiers 
  4946. before the FILE_TYPE but that syntax is being phased out in favor of the syntax 
  4947. described here. 
  4948.  
  4949. Filenames specified in the material_map statements will be searched for in the 
  4950. home (current) directory first, and if not found, will then be searched for in 
  4951. directories specified by any "-L" (library path) options active. This would 
  4952. facilitate keeping all your material maps files in a separate subdirectory, and 
  4953. giving an "-L" option on the command line to where your library of material 
  4954. maps are. 
  4955.  
  4956. By default, the material is mapped onto the X-Y plane.  The material is 
  4957. "projected" onto the object as though there were a slide projector somewhere in 
  4958. the -Z direction.  The material exactly fills the square area from x,y 
  4959. coordinates (0,0) to (1,1) regardless of the material's original size in 
  4960. pixels.  If you would like to change this default, you may translate, rotate or 
  4961. scale the normal or texture to map it onto the object's surface as desired. 
  4962.  
  4963. If you would like to change this default orientation, you may translate, rotate 
  4964. or scale the texture to map it onto the object's surface as desired. 
  4965.  
  4966. Note that no other pigment, normal or finish statements may be added to the 
  4967. texture outside the material_map. This is illegal: 
  4968.  
  4969.         texture {
  4970.           material_map {
  4971.             gif "matmap.gif"
  4972.             texture {T1}
  4973.             texture {T2}
  4974.             texture {T3}
  4975.           }
  4976.           finish {phong 1.0}
  4977.         }
  4978.  
  4979. The finish must be individually added to each texture. 
  4980.  
  4981. Note that earlier versions of POV-Ray allowed such specifications but they were 
  4982. ignored.  The above restrictions on syntax were necessary for various bug 
  4983. fixes.  This means some POV-Ray 1.0 scenes using material_maps many need minor 
  4984. modifications that cannot be done automatically with the version compatibility 
  4985. mode. 
  4986.  
  4987. The textures within a material_map texture may be layered but material_map 
  4988. textures do don't work as part of a layered texture.  To use a layered texture 
  4989. inside a material_map you must declare it as a texture identifier and invoke it 
  4990. in the texture list. 
  4991.  
  4992.  
  4993. ΓòÉΓòÉΓòÉ 6.4.4.2.2. 5.4.4.2.2  Material_map options. ΓòÉΓòÉΓòÉ
  4994.  
  4995. The "once" and "map_type" options may be used with material_maps exactly like 
  4996. image_map or bump_map.  The "interpolate" keyword also is allowed but it 
  4997. interpolates the map indices rather than the colors.  In most cases this 
  4998. results in a worse image instead of a better image.  Future versions will fix 
  4999. this problem. 
  5000.  
  5001.  
  5002. ΓòÉΓòÉΓòÉ 6.4.5. 5.4.5  Layered Textures ΓòÉΓòÉΓòÉ
  5003.  
  5004. It is possible to create a variety of special effects using layered textures. 
  5005. A layered texture is one where several textures that are partially transparent 
  5006. are laid one on top of the other to create a more complex texture. The 
  5007. different texture layers show through the transparent portions to create the 
  5008. appearance of one texture that is a combination of several textures. 
  5009.  
  5010. You create layered textures by listing two or more textures one right after the 
  5011. other. The last texture listed will be the top layer, the first one listed will 
  5012. be the bottom layer. All textures in a layered texture other than the bottom 
  5013. layer should have some transparency.  For example: 
  5014.  
  5015.         object {
  5016.           My_Object
  5017.           texture {T1}  // the bottom layer
  5018.           texture {T2}  // a semi-transparent layer
  5019.           texture {T3}  // the top semi-transparent layer
  5020.         }
  5021.  
  5022. In this example T2 shows only where T3 is transparent and T1 shows only where 
  5023. T2 and T3 are transparent. 
  5024.  
  5025. The color of underlying layers is filtered by upper layers but the results do 
  5026. not look exactly like a series of transparent surfaces.  If you had a stack of 
  5027. surfaces with the textures applied to each, the light would be filtered twice: 
  5028. once on the way in as the lower layers are illuminated by filtered light and 
  5029. once on the way out.  Layered textures do not filter the illumination on the 
  5030. way in.  Other parts of the lighting calculations work differently as well. 
  5031. The result look great and allow for fantastic looking textures but they are 
  5032. simply different from multiple surfaces.  See STONES.INC in the standard 
  5033. include files for some magnificent layered textures. 
  5034.  
  5035. Note layered textures must use the "texture{...}" wrapped around any pigment, 
  5036. normal or finish statements.  Do not use multiple pigment, normal or finish 
  5037. statements without putting them inside the texture statement. 
  5038.  
  5039. Layered textures may be declared.  For example: 
  5040.  
  5041.         #declare Layered_Examp=
  5042.               texture {T1}
  5043.               texture {T2}
  5044.               texture {T3}
  5045.  
  5046. Then invoke it as follows: 
  5047.  
  5048.         object {
  5049.           My_Object
  5050.           texture {
  5051.             Layer_Examp
  5052.             // Any pigment, normal or finish here
  5053.             // modifies the bottom layer only.
  5054.           }
  5055.         }
  5056.  
  5057.  
  5058. ΓòÉΓòÉΓòÉ 6.4.6. 5.4.6  Default Texture ΓòÉΓòÉΓòÉ
  5059.  
  5060. POV-Ray creates a default texture when it begins processing.  You may change 
  5061. those defaults as described below.  Every time you specify a "texture{...}" 
  5062. statement, POV-Ray creates a copy of the default texture. Anything items you 
  5063. put in the texture statement override the default settings.  If you attach a 
  5064. pigment, normal or finish to an object without any texture statement then 
  5065. POV-Ray checks to see if a texture has already been attached.  If it has a 
  5066. texture then the pigment, normal or finish will modify that existing texture. 
  5067. If no texture has yet been attached to the object then the default texture is 
  5068. copied and the pigment, normal or finish will modify that texture. 
  5069.  
  5070. You may change the default texture, pigment, normal or finish using the 
  5071. language directive "#default {...}" as follows: 
  5072.  
  5073.         #default {
  5074.           texture {
  5075.             pigment {...}
  5076.             normal  {...}
  5077.             finish  {...}
  5078.           }
  5079.         }
  5080.  
  5081. Or you may change just part of it like this: 
  5082.  
  5083.         #default {
  5084.            pigment {...}
  5085.         }
  5086.  
  5087. This still changes the pigment of the default texture.  At any time there is 
  5088. only one default texture made from the default pigment, normal and finish.  The 
  5089. example above does not make a separate default for pigments alone. Note: 
  5090. Special textures tiles and material_map may not be used as defaults. 
  5091.  
  5092. You may change the defaults several times throughout a scene as you wish. 
  5093. Subsequent #default statements begin with the defaults that were in effect at 
  5094. the time.  If you wish to reset to the original POV-Ray defaults then you 
  5095. should first save them as follows: 
  5096.  
  5097.         //At top of file
  5098.         #declare Original_Default = texture {}
  5099.  
  5100. later after changing defaults you may restore it with... 
  5101.  
  5102.         #default {texture {Original_Default}}
  5103.  
  5104. If you do not specify a texture for an object then the default texture is 
  5105. attached when the object appears in the scene.  It is not attached when an 
  5106. object is declared.  For example: 
  5107.  
  5108.         #declare My_Object=
  5109.           sphere{<0,0,0>,1}  // Default texture not applied
  5110.  
  5111.         object{My_Object}    // Default texture added here
  5112.  
  5113. You may force a default texture to be added by using an empty texture statement 
  5114. as follows: 
  5115.  
  5116.         #declare My_Thing=
  5117.           sphere{<0,0,0>,1 texture{}}  // Default texture applied
  5118.  
  5119. The original POV-Ray defaults for all items are given throughout the 
  5120. documentation under each appropriate section. 
  5121.  
  5122.  
  5123. ΓòÉΓòÉΓòÉ 6.5. 5.5  Camera ΓòÉΓòÉΓòÉ
  5124.  
  5125. Every scene in POV-Ray has a camera defined.  If you do not specify a camera 
  5126. then a default camera is used.  The camera definition describes the position, 
  5127. angle and properties of the camera viewing the scene. POV-Ray uses this 
  5128. definition to do a simulation of the camera in the ray tracing universe and 
  5129. "take a picture" of your scene. 
  5130.  
  5131. The camera simulated in POV-Ray is a pinhole camera. Pinhole cameras have a 
  5132. fixed focus so all elements of the scene will always be perfectly in focus. The 
  5133. pinhole camera is not able to do soft focus or depth of field effects. 
  5134.  
  5135. A total of 6 vectors may be specified to define the camera but only a few of 
  5136. those are needed to in most cases.  Here is an introduction to simple camera 
  5137. placement. 
  5138.  
  5139.  
  5140. ΓòÉΓòÉΓòÉ 6.5.1. 5.5.1  Location And Look_At ΓòÉΓòÉΓòÉ
  5141.  
  5142. Under many circumstances just two vectors in the camera statement are all you 
  5143. need: location and look_at.  For example: 
  5144.  
  5145.         camera {
  5146.           location <3,5,-10>
  5147.           look_at  <0,2,1>
  5148.         }
  5149.  
  5150. The location is simply the X, Y, Z coordinates of the camera. The camera can be 
  5151. located anywhere in the ray tracing universe.  The default location is <0,0,0>. 
  5152. The look_at vector tells POV-Ray to pan and tilt the camera until it is looking 
  5153. at the specified X, Y, Z coordinate.  By default the camera looks at a point 
  5154. one unit in the +Z direction from the location. 
  5155.  
  5156. The look_at specification should almost always be the LAST item in the camera 
  5157. statement.  If other camera items are placed after the look_at vector then the 
  5158. camera may not continue to look at the specified point. 
  5159.  
  5160.  
  5161. ΓòÉΓòÉΓòÉ 6.5.2. 5.5.2  The Sky Vector ΓòÉΓòÉΓòÉ
  5162.  
  5163. Normally POV-Ray pans left or right by rotating about the Y axis until it lines 
  5164. up with the look_at point and then tilts straight up or down until the point is 
  5165. met exactly.  However you may want to slant the camera sideways like an 
  5166. airplane making a banked turn.  You may change the tilt of the camera using the 
  5167. "sky" vector.  For example: 
  5168.  
  5169.         camera {
  5170.           location <3,5,-10>
  5171.           sky      <1,1,0>
  5172.           look_at  <0,2,1>
  5173.         }
  5174.  
  5175. This tells POV-Ray to roll the camera until the top of the camera is in line 
  5176. with the sky vector.  Imagine that the sky vector is an antenna pointing out of 
  5177. the top of the camera.  Then it uses the "sky" vector as the axis of rotation 
  5178. left or right and then to tilt up or down in line with the "sky" vector.  In 
  5179. effect you're telling POV-Ray to assume that the sky isn't straight up. Note 
  5180. that the sky vector must appear before the look_at vector.  The sky vector does 
  5181. nothing on its own.  It only modifies the way the look_at vector turns the 
  5182. camera. The default value for sky is <0,1,0>. 
  5183.  
  5184.  
  5185. ΓòÉΓòÉΓòÉ 6.5.3. 5.5.3  The Direction Vector ΓòÉΓòÉΓòÉ
  5186.  
  5187. The "direction" vector serves two purposes.  It tells POV-Ray the initial 
  5188. direction to point the camera before moving it with look_at or rotate vectors. 
  5189. It also controls the field of view. 
  5190.  
  5191. Note that this is only the initial direction.  Normally, you will use the 
  5192. look_at keyword, not the direction vector to point the camera in its actual 
  5193. direction. 
  5194.  
  5195. The length of the direction vector tells POV-Ray to use a telephoto or 
  5196. wide-angle view.  It is the distance from the camera location to the imaginary 
  5197. "view window" that you are looking through.  A short direction vector gives a 
  5198. wide angle view while a long direction gives a narrow, telephoto view. 
  5199.  
  5200. This figure illustrates the effect: 
  5201.  
  5202.                  |\                                            |\
  5203.                  | \                                           | \
  5204.                  |  \                                          |  \
  5205.                  |   \                                         |   \
  5206.   Location       |   |            Location                     |   |
  5207.       *------------> |                *--------------------------> |
  5208.         Direction|   |                                         |   |
  5209.                  |   |                                         |   |
  5210.                  |   |                                         |   |
  5211.                   \  |                                          \  |
  5212.                    \ |                                           \ |
  5213.                     \|                                            \|
  5214.  
  5215. Short direction gives wide view...        long direction narrows view.
  5216.  
  5217. The default value is "direction <0,0,1>". 
  5218.  
  5219. Be careful with short direction vector lengths like 1.0 and less. You may 
  5220. experience distortion on the edges of your images. Objects will appear to be 
  5221. shaped strangely. If this happens, move the location back and make the 
  5222. direction vector longer. 
  5223.  
  5224. Wide angle example: 
  5225.  
  5226.         camera {
  5227.           location  <3,5,-10>
  5228.           direction <0,0,1>
  5229.           look_at   <0,2,1>
  5230.         }
  5231.  
  5232. Zoomed in telephoto example: 
  5233.  
  5234.         camera {
  5235.           location <3,5,-10>
  5236.           direction <0,0,8>
  5237.           look_at  <0,2,1>
  5238.         }
  5239.  
  5240.  
  5241. ΓòÉΓòÉΓòÉ 6.5.4. 5.5.4  Up And Right Vectors ΓòÉΓòÉΓòÉ
  5242.  
  5243. The "up" vector defines the height of the view window.  The "right" vector 
  5244. defines the width of the view window.  This figure illustrates the relationship 
  5245. of these vectors: 
  5246.  
  5247.         --------------------------
  5248.        |             ^            |
  5249.        |   up <0,1,0>|            |
  5250.        |             |            |
  5251.        |             |            |
  5252.        |             |            |
  5253.        |             |            |
  5254.        |             |            |
  5255.        |------------------------->|
  5256.        |   right<1.33,0,0>        |
  5257.        |             |            |
  5258.        |             |            |
  5259.        |             |            |
  5260.        |             |            |
  5261.        |             |            |
  5262.        |             |            |
  5263.         --------------------------
  5264.  
  5265.  
  5266. ΓòÉΓòÉΓòÉ 6.5.4.1. 5.5.4.1  Aspect Ratio ΓòÉΓòÉΓòÉ
  5267.  
  5268. Together these vectors define the "aspect ratio" (height to width ratio) of the 
  5269. resulting image.  The default values "up <0,1,0>" and "right <1.33,0,0>" 
  5270. results in an aspect ratio of about 4 to 3.  This is the aspect ratio of a 
  5271. typical computer monitor.  If you wanted a tall skinny image or a short wide 
  5272. panoramic image or a perfectly square image then you should adjust the up and 
  5273. right vectors to the appropriate proportions. 
  5274.  
  5275. Most computer video modes and graphics printers use perfectly square pixels. 
  5276. For example Macintosh displays and IBM S-VGA modes 640x480, 800x600 and 
  5277. 1024x768 all use square pixels.  When your intended viewing method uses square 
  5278. pixels then the width and height you set with the +W and +H switches should 
  5279. also have the same ratio as the right and up vectors. Note that 640/480=4/3 so 
  5280. the ratio is proper for this square pixel mode. 
  5281.  
  5282. Not all display modes use square pixels however.  For example IBM VGA mode 
  5283. 320x200 and Amiga 320x400 modes do not use square pixels.  These two modes 
  5284. still produce a 4/3 aspect ratio image.  Therefore images intended to be viewed 
  5285. on such hardware should still use 4/3 ratio on their up & right vectors but the 
  5286. +W and +H settings will not be 4/3. 
  5287.  
  5288. For example: 
  5289.  
  5290.         camera {
  5291.           location <3,5,-10>
  5292.           up       <0,1,0>
  5293.           right    <1,0,0>
  5294.           look_at  <0,2,1>
  5295.         }
  5296.  
  5297. This specifies a perfectly square image.  On a square pixel display like SVGA 
  5298. you would use +W and +H settings such as +W480 +H480 or +W600 +H600. However on 
  5299. the non-square pixel Amiga 320x400 mode you would want to use values of +W240 
  5300. +H400 to render a square image. 
  5301.  
  5302.  
  5303. ΓòÉΓòÉΓòÉ 6.5.4.2. 5.5.4.2  Handedness ΓòÉΓòÉΓòÉ
  5304.  
  5305. The "right" vector also describes the direction to the right of the camera. It 
  5306. tells POV-Ray where the right side of your screen is.  The sign of the right 
  5307. vector also determines the "handedness" of the coordinate system in use. The 
  5308. default right statement is: 
  5309.  
  5310.         right <1.33, 0, 0>
  5311.  
  5312. This means that the +X direction is to the right.  It is called a "left- 
  5313. handed" system because you can use your left hand to keep track of the axes. 
  5314. Hold out your left hand with your palm facing to your right.  Stick your thumb 
  5315. up.  Point straight ahead with your index finger. Point your other fingers to 
  5316. the right.  Your bent fingers are pointing to the +X direction.  Your thumb now 
  5317. points +Y.  Your index finger points +Z. 
  5318.  
  5319. To use a right-handed coordinate system, as is popular in some CAD programs and 
  5320. other ray tracers, make the same shape using your right hand.  Your thumb still 
  5321. points up in the +Y direction and your index finger still points forward in the 
  5322. +Z direction but your other fingers now say the +X is to the left.  That means 
  5323. that the "right" side of your screen is now in the -X direction. To tell 
  5324. POV-Ray to compensate for this you should use a negative X value in the "right" 
  5325. vector like this: 
  5326.  
  5327.         right <-1.33, 0, 0>
  5328. Some CAD systems, like AutoCAD, also have the assumption that the Z axis is the 
  5329. "elevation" and is the "up" direction instead of the Y axis. If this is the 
  5330. case you will want to change your "up" and "direction" as well. Note that the 
  5331. up, right, and direction vectors must always remain perpendicular to each other 
  5332. or the image will be distorted. 
  5333.  
  5334.  
  5335. ΓòÉΓòÉΓòÉ 6.5.5. 5.5.5  Transforming The Camera ΓòÉΓòÉΓòÉ
  5336.  
  5337. The "translate" and "rotate" commands can re-position the camera once you've 
  5338. defined it. 
  5339.  
  5340. For example: 
  5341.  
  5342.         camera {
  5343.           location  < 0,  0,  0>
  5344.           direction < 0,  0,  1>
  5345.           up        < 0,  1,  0>
  5346.           right     < 1,  0,  0>
  5347.           rotate    <30, 60, 30>
  5348.           translate < 5,  3,  4>
  5349.         }
  5350.  
  5351. In this example, the camera is created, then rotated by 30 degrees about the X 
  5352. axis, 60 degrees about the Y axis, and 30 degrees about the Z axis, then 
  5353. translated to another point in space. 
  5354.  
  5355.  
  5356. ΓòÉΓòÉΓòÉ 6.5.6. 5.5.6  Camera Identifiers ΓòÉΓòÉΓòÉ
  5357.  
  5358. You may declare several camera identifiers if you wish.  This makes it easy to 
  5359. quickly change cameras.  For example: 
  5360.  
  5361.         #declare Long_Lens=
  5362.               camera {
  5363.                 location -z*100
  5364.                 direction z*50
  5365.               }
  5366.         #declare Short_Lens=
  5367.               camera {
  5368.                 location -z*50
  5369.                 direction z*10
  5370.               }
  5371.  
  5372.         camera {
  5373.           Long_Lens    //edit this line to change lenses
  5374.           look_at Here
  5375.         }
  5376.  
  5377.  
  5378. ΓòÉΓòÉΓòÉ 6.6. 5.6  Misc Features ΓòÉΓòÉΓòÉ
  5379.  
  5380. Here are a variety of other topics about POV-Ray features. 
  5381.  
  5382.  
  5383. ΓòÉΓòÉΓòÉ 6.6.1. 5.6.1  Fog ΓòÉΓòÉΓòÉ
  5384.  
  5385. POV-Ray includes the ability to render fog. To add fog to a scene, place the 
  5386. following declaration outside of any object definitions: 
  5387.  
  5388.         fog {
  5389.           color Gray70      // the fog color
  5390.           distance 200.0    // distance for 100% fog color
  5391.         }
  5392.  
  5393. The fog color is then blended into the current pixel color at a rate calculated 
  5394. as: 
  5395.  
  5396.         1-exp(-depth/distance) =
  5397.         1-exp(-200/200) =
  5398.         1-exp(-1) =
  5399.         1-.37... =
  5400.         0.63...
  5401.  
  5402. So at depth 0, the color is pure (1.0) with no fog (0.0). At the fog distance, 
  5403. you'll get 63% of the color from the object's color and 37% from the fog color. 
  5404.  
  5405. Subtle use of fog can add considerable realism and depth cuing to a scene 
  5406. without adding appreciably to the overall rendering times.  Using a black or 
  5407. very dark gray fog can be used to simulate attenuated lighting by darkening 
  5408. distant objects. 
  5409.  
  5410.  
  5411. ΓòÉΓòÉΓòÉ 6.6.2. 5.6.2  Max_Trace_Level ΓòÉΓòÉΓòÉ
  5412.  
  5413. The "#max_trace_level" directive sets a variable that defines how many levels 
  5414. that POV-Ray will trace a ray. This is used when a ray is reflected or is 
  5415. passing through a transparent object. When a ray hits a reflective surface, it 
  5416. spawns another ray to see what that point reflects, that's trace level 1. If it 
  5417. hits another reflective surface, then another ray is spawned and it goes to 
  5418. trace level 2. The maximum level by default is 5. 
  5419.  
  5420. If max trace level is reached before a non-reflecting surface is found, then 
  5421. the color is returned as black. Raise max_trace_level if you see black in a 
  5422. reflective surface where there should be a color. 
  5423.  
  5424. The other symptom you could see is with transparent objects. For instance, try 
  5425. making a union of concentric spheres with the Cloud_Sky texture on them. Make 
  5426. ten of them in the union with radius's from 1-10 then render the Scene. The 
  5427. image will show the first few spheres correctly, then black. This is because a 
  5428. new level is used every time you pass through a transparent surface.  Raise 
  5429. max_trace_level to fix this problem.  For example: 
  5430.  
  5431.         #max_trace_level 20
  5432.  
  5433. Note: Raising max_trace_level will use more memory and time and it could cause 
  5434. the program to crash with a stack overflow error. Values for max_trace_level 
  5435. are not restricted, so it can be set to any number as long as you have the time 
  5436. and memory. 
  5437.  
  5438.  
  5439. ΓòÉΓòÉΓòÉ 6.6.3. 5.6.3  Max_Intersections ΓòÉΓòÉΓòÉ
  5440.  
  5441. POV-Ray uses a set of internal stacks to collect ray/object intersection 
  5442. points.  The usual maximum number of entries in these "I-Stacks" is 64. Complex 
  5443. scenes may cause these stacks to overflow.  POV-Ray doesn't stop but it may 
  5444. incorrectly render your scene.  When POV-Ray finishes rendering, a number of 
  5445. statistics are displayed.  If you see "I-Stack Overflows" reported in the 
  5446. statistics, you should increase the stack size.  Add a directive to your scene 
  5447. as follows: 
  5448.  
  5449.         #max_intersections 200
  5450.  
  5451. If the "I-Stack Overflows" remain, increase this value until they stop. 
  5452.  
  5453.  
  5454. ΓòÉΓòÉΓòÉ 6.6.4. 5.6.4  Background ΓòÉΓòÉΓòÉ
  5455.  
  5456. A background color can be specified if desired.  Any ray that doesn't hit an 
  5457. object will be colored with this color.  The default background is black.  The 
  5458. syntax for background is: 
  5459.  
  5460.         background { color SkyBlue }
  5461.  
  5462. Using a colored background takes up no extra time for the ray tracer, making it 
  5463. a very economical, although limited, feature. Only solid colors can be 
  5464. specified for a background. Textures cannot be used.  No shadows will be cast 
  5465. on it, which makes it very useful, but at the same time, it has no "roundness", 
  5466. or shading, and can sometimes cause a scene to look "flat".  Use background 
  5467. with restraint.  It's often better, although a bit slower, to use a "sky 
  5468. sphere", but there are times when a solid background is just what you need. 
  5469.  
  5470.  
  5471. ΓòÉΓòÉΓòÉ 6.6.5. 5.6.5  The #Version Directive ΓòÉΓòÉΓòÉ
  5472.  
  5473. Although POV-Ray 2.0 has had significant changes to the language over POV- Ray 
  5474. 1.0, almost all 1.0 scenes will still work if the compatibility mode is set to 
  5475. 1.0.  The +MV switch described earlier, sets the initial mode.  The default is 
  5476. +MV2.0. 
  5477.  
  5478. Inside a scene file you may turn compatibility off or on using the "#version" 
  5479. directive.  For example: 
  5480.  
  5481.         #version 1.0
  5482.         // Put some version 1.0 statements here
  5483.  
  5484.         #version 2.0
  5485.         // Put some version 2.0 statements here
  5486.  
  5487. Note you may not change versions inside an object or declaration. 
  5488.  
  5489. The primary purpose of the switch is to turn off float and expression parsing 
  5490. so that commas are not needed.  It also turns off some warning messages. 
  5491.  
  5492. Note some changes in tiles and material_maps cannot be fixed by turning the 
  5493. version compatibility on.  It may require hand editing of those statements. See 
  5494. the special texture section for details. 
  5495.  
  5496. Future versions of POV-Ray may not continue to maintain full backward 
  5497. compatibility.  We strongly encourage you to phase in 2.0 syntax as much as 
  5498. possible. 
  5499.  
  5500.  
  5501. ΓòÉΓòÉΓòÉ 7. APPENDIX A  Common Questions And Answers ΓòÉΓòÉΓòÉ
  5502.  
  5503. Q: I get a floating point error on certain pictures. What's wrong? 
  5504.  
  5505. A: The ray tracer performs many thousands of floating point operations when 
  5506. tracing a scene. If checks were added to each one for overflow or underflow, 
  5507. the program would be much slower. If you get this problem, first look through 
  5508. your scene file to make sure you're not doing something like: 
  5509.  
  5510. o Scaling something by 0 in any dimension. 
  5511.  
  5512.   Ex: scale <34, 2, 0> will generate a warning. 
  5513.  
  5514. o Making the look_at point the same as the location in the camera 
  5515.  
  5516. o Looking straight down at the look_at point 
  5517.  
  5518. o Defining triangles with two points the same (or nearly the same) 
  5519.  
  5520. o Using a roughness value of zero (0). 
  5521.  
  5522. If it doesn't seem to be one of these problems, please let us know. If you do 
  5523. have such troubles, you can try to isolate the problem in the input scene file 
  5524. by commenting out objects or groups of objects until you narrow it down to a 
  5525. particular section that fails. Then try commenting out the individual 
  5526. characteristics of the offending object. 
  5527.  
  5528. Q: Are planes 2D objects or are they 3D but infinitely thin? 
  5529.  
  5530. A: Neither. Planes are 3D objects that divide the world into two half- spaces. 
  5531. The space in the direction of the surface normal is considered outside and the 
  5532. other space is inside. In other words, planes are 3D objects that are 
  5533. infinitely thick. For the plane, plane { y, 0 }, every point with a positive Y 
  5534. value is outside and every point with a negative Y value is inside. 
  5535.  
  5536.                             ^
  5537.                             |
  5538.                             |
  5539.                             |  Outside
  5540.                      _______|_______
  5541.                          Inside
  5542.  
  5543. Q: I'd like to go through the program and hand-optimize the assembly code in 
  5544. places to make it faster. What should I optimize? 
  5545.  
  5546. A: Don't bother. With hand optimization, you'd spend a lot of time to get 
  5547. perhaps a 5-10% speed improvement at the cost of total loss of portability. If 
  5548. you use a better ray-surface intersection algorithm, you should be able to get 
  5549. an order of magnitude or more improvement. Check out some books and papers on 
  5550. ray tracing for useful techniques. Specifically, check out "Spatial 
  5551. Subdivision" and "Ray Coherence" techniques. 
  5552.  
  5553. Q: Objects on the edges of the screen seem to be distorted. Why? 
  5554.  
  5555. A: If the direction vector of the camera is not very long, you may get 
  5556. distortion at the edges of the screen. Try moving the location back and raising 
  5557. the value of the direction vector. 
  5558.  
  5559. Q: How do you position planar image maps without a lot of trial and error? 
  5560.  
  5561. A: By default, images will be mapped onto the range 0,0 to 1,1 in the 
  5562. appropriate plane. You should be able to translate, rotate, and scale the image 
  5563. from there. 
  5564.  
  5565. Q: How do you calculate the surface normals for smooth triangles? 
  5566.  
  5567. A:  There are two ways of getting another program to calculate them for you. 
  5568. There are now several utilities to help with this. 
  5569.  
  5570.  1. Depending on the type of input to the program, you may be able to calculate 
  5571.     the surface normals directly. For example, if you have a program that 
  5572.     converts B-Spline or Bezier Spline surfaces into POV-Ray format files, you 
  5573.     can calculate the surface normals from the surface equations. 
  5574.  
  5575.  2. If your original data was a polygon or triangle mesh, then it's not quite 
  5576.     so simple. You have to first calculate the surface normals of all the 
  5577.     triangles. This is easy to do - you just use the vector cross-product of 
  5578.     two sides (make sure you get the vectors in the right order). Then, for 
  5579.     every vertex, you average the surface normals of the triangles that meet at 
  5580.     that vertex.  These are the normals you use for smooth triangles. Look for 
  5581.     the utilities such as RAW2POV.  RAW2POV has an excellent bounding scheme 
  5582.     and the ability to specify a smoothing threshold. 
  5583.  
  5584. Q: When I render parts of a picture on different systems, the textures don't 
  5585. match when I put them together. Why? 
  5586.  
  5587. A: The appearance of a texture depends on the particular random number 
  5588. generator used on your system. POV-Ray seeds the random number generator with a 
  5589. fixed value when it starts, so the textures will be consistent from one run to 
  5590. another or from one frame to another so long as you use the same executables. 
  5591. Once you change executables, you will likely change the random number generator 
  5592. and, hence, the appearance of the texture. There is an example of a standard 
  5593. ANSI random number generator provided in IBM.C, include it in your 
  5594. machine-specific code if you are having consistency problems. 
  5595.  
  5596. Q: I created an object that passes through its bounding volume. At times, I can 
  5597. see the parts of the object that are outside the bounding volume. Why does this 
  5598. happen? 
  5599.  
  5600. A: Bounding volumes are not designed to change the shape of the object. They 
  5601. are strictly a realtime improvement feature. The ray tracer trusts you when you 
  5602. say that the object is enclosed by a bounding volume. The way it uses bounding 
  5603. volumes is very simple: If the ray hits the bounding volume (or the ray's 
  5604. origin is inside the bounding volume),when the object is tested against that 
  5605. ray. Otherwise, we ignore the object. If the object extends beyond the bounding 
  5606. volume, anything goes. The results are undefined. It's quite possible that you 
  5607. could see the object outside the bounding volume and it's also possible that it 
  5608. could be invisible. It all depends on the geometry of the scene. If you want 
  5609. this effect use a clipped_by volume instead of bounded_by or use clipped_by { 
  5610. bounded_by } if you wish to clip and bound with the same object. 
  5611.  
  5612.  
  5613. ΓòÉΓòÉΓòÉ 8. APPENDIX B  Tips And Hints ΓòÉΓòÉΓòÉ
  5614.  
  5615.  
  5616. ΓòÉΓòÉΓòÉ 8.1. B.1  Scene Design ΓòÉΓòÉΓòÉ
  5617.  
  5618. There are a number of excellent shareware CAD style modelers available on the 
  5619. DOS platform now that will create POV-Ray scene files.  The online systems 
  5620. mentioned elsewhere in this document are the best places to find these. 
  5621.  
  5622. Hundreds of special-purpose utilities have been written for POV-Ray; data 
  5623. conversion programs, object generators, shell-style "launchers", and more. It 
  5624. would not be possible to list them all here, but again, the online systems 
  5625. listed will carry most of them. Most, following the POV-Ray spirit, are 
  5626. freeware or inexpensive shareware. 
  5627.  
  5628. Some extremely elaborate scenes have been designed by drafting on graph paper. 
  5629. Raytracer Mike Miller recommends graph paper with a grid divided in tenths, 
  5630. allowing natural decimal conversions. 
  5631.  
  5632. Start out with a "boilerplate" scene file, such as a copy of BASICVUE.POV, and 
  5633. edit that.  In general, place your objects near and around the "origin" (0, 0, 
  5634. 0) with the camera in the negative z direction, looking at the origin. 
  5635. Naturally, you will break from this rule many times, but when starting out, 
  5636. keep things simple. 
  5637.  
  5638. For basic, boring, but dependable lighting, place a light source at or near the 
  5639. position of the camera.  Objects will look flat, but at least you will see 
  5640. them.  From there, you can move it slowly into a better position. 
  5641.  
  5642.  
  5643. ΓòÉΓòÉΓòÉ 8.2. B.2  Scene Debugging Tips ΓòÉΓòÉΓòÉ
  5644.  
  5645. To see a quick version of your picture, render it very small. With fewer pixels 
  5646. to calculate the ray tracer can finish more quickly. -w160 -h100 is a good 
  5647. size. 
  5648.  
  5649. Use the +Q "quality" switch when appropriate. 
  5650.  
  5651. If there is a particular area of your picture that you need to see in high 
  5652. resolution, perhaps with anti-aliasing on (perhaps a fine-grained wood 
  5653. texture), use the +SC, +EC. +SR, and +ER switches to isolate a "window". 
  5654.  
  5655. If your image contains a lot of inter-reflections, set max_trace_level to a low 
  5656. value such as 1 or 2.  Don't forget to put it back up when you're finished! 
  5657.  
  5658. "Turn off" any unnecessary lights.  Comment out extended light and spotlight 
  5659. keywords when not needed for debugging.  Again, don't forget to put them back 
  5660. in before you retire for the night with a final render running! 
  5661.  
  5662. If you've run into an error that is eluding you by visual examination, it's 
  5663. time to start bracketing your file.  Use the block comment characters ( /* ... 
  5664. */ ) to disable most of your scene and try to render again.  If you no longer 
  5665. get an error, the problem naturally lies somewhere within the disabled area. 
  5666. Slow and methodical testing like this will eventually get you to a point where 
  5667. you will either be able to spot the bug, or go quietly insane.  Maybe both. 
  5668.  
  5669. If you seem to have "lost" yourself or an object (a common experience for 
  5670. beginners) there are a few tricks that can sometimes help: 
  5671.  
  5672.  1. Move your camera way back to provide a long range view. This may not help 
  5673.     with very small objects which tend to be less visible at a distance, but 
  5674.     it's a nice trick to keep up your sleeve. 
  5675.  
  5676.  2. Try setting the ambient value to 1.0 if you suspect that the object may 
  5677.     simply be hidden from the lights.  This will make it self-illuminated and 
  5678.     you'll be able to see it even with no lights in the scene. 
  5679.  
  5680.  3. Replace the object with a larger, more obvious "stand-in" object like a 
  5681.     large sphere or box.  Be sure that all the same transformations are applied 
  5682.     to this new shape so that it ends up in the same spot. 
  5683.  
  5684.  
  5685. ΓòÉΓòÉΓòÉ 8.3. B.3  Animation ΓòÉΓòÉΓòÉ
  5686.  
  5687. When animating objects with solid textures, the textures must move with the 
  5688. object, i.e. apply the same rotate or translate functions to the texture as to 
  5689. the object itself. This is now done automatically if the transformations are 
  5690. placed _after_ the texture block. 
  5691.  
  5692. Example: 
  5693.  
  5694.         shape { ...
  5695.           pigment { ... }
  5696.           scale < ... >
  5697.         }
  5698.  
  5699. Will scale the shape and pigment texture by the same amount. 
  5700.  
  5701. While: 
  5702.  
  5703.         shape { ...
  5704.           scale < ... >
  5705.           pigment { ... }
  5706.         }
  5707.  
  5708. Will scale the shape, but not the pigment. 
  5709.  
  5710. Constants can be declared for most of the data types in the program including 
  5711. floats and vectors. By writing these to #include files, you can easily separate 
  5712. the parameters for an animation into a separate file. 
  5713.  
  5714. Some examples of declared constants would be: 
  5715.  
  5716.         #declare Y_Rotation = 5.0 * clock
  5717.         #declare ObjectRotation = <0, Y_Rotation, 0>
  5718.         #declare MySphere = sphere { <0, 0, 0>, 1.1234 }
  5719. Other examples can be found scattered throughout the sample scene files. 
  5720.  
  5721. DOS users: Get ahold of DTA.EXE (Dave's Targa Animator) for creating .FLI/.FLC 
  5722. animations.  AAPLAY.EXE and PLAY.EXE are common viewers for this type of file. 
  5723.  
  5724. When moving the camera in an animation (or placing one in a still image, for 
  5725. that matter) avoid placing the camera directly over the origin.  This will 
  5726. cause very strange errors.  Instead, move off center slightly and avoid 
  5727. hovering directly over the scene. 
  5728.  
  5729.  
  5730. ΓòÉΓòÉΓòÉ 8.4. B.4  Textures ΓòÉΓòÉΓòÉ
  5731.  
  5732. Wood is designed like a "log", with growth rings aligned along the z axis. 
  5733. Generally these will look best when scaled down by about a tenth (to a 
  5734. unit-sized object). Start out with rather small value for the turbulence, too 
  5735. (around 0.05 is good for starters). 
  5736.  
  5737. The marble texture is designed around a pigment primitive that is much like an 
  5738. x-gradient.  When turbulated, the effect is different when viewed from the 
  5739. "side" or from the "end".  Try rotating it by 90 degrees on the y axis to see 
  5740. the difference. 
  5741.  
  5742. You cannot get specular highlights on a totally black object. Try using a very 
  5743. dark gray, say Gray10 or Gray15, instead. 
  5744.  
  5745.  
  5746. ΓòÉΓòÉΓòÉ 8.5. B.5  Height Fields ΓòÉΓòÉΓòÉ
  5747.  
  5748. Try using POV-Ray itself to create images for height_fields: 
  5749.  
  5750.         camera { location <0, 0, -2> }
  5751.           plane { z, 0
  5752.            finish { ambient 1 }    // needs no light sources
  5753.            pigment { bozo }        // or whatever.  Experiment.
  5754.         }
  5755.  
  5756. That's all you'll need to create a .tga file that can then be used as a height 
  5757. field in another image! 
  5758.  
  5759.  
  5760. ΓòÉΓòÉΓòÉ 8.6. B.6  Field-Of-View ΓòÉΓòÉΓòÉ
  5761.  
  5762. By making the direction vector in the camera longer, you can achieve the effect 
  5763. of a tele-photo lens. Shorter direction vectors will give a kind of wide-angle 
  5764. affect, but you may see distortion at the edges of the image. See the file 
  5765. "fov.inc" in the \POVRAY\INCLUDE directory for some predefined field-of-view 
  5766. values. 
  5767.  
  5768. If your spheres and circles aren't round, try increasing the direction vector 
  5769. slightly.  Often a value of 1.5 works better than the 1.0 default when spheres 
  5770. appear near the edge of the screen. 
  5771.  
  5772.  
  5773. ΓòÉΓòÉΓòÉ 8.7. B.7  Converting "HANDEDNESS" ΓòÉΓòÉΓòÉ
  5774.  
  5775. If you are importing images from other systems, you may find that the shapes 
  5776. are backwards (left-to-right inverted) and no rotation can make them correct. 
  5777.  
  5778. Often, all you have to do is negate the terms in the right vector of the camera 
  5779. to flip the camera left-to-right (use the "right-hand" coordinate system). 
  5780. Some programs seem to interpret the coordinate systems differently, however, so 
  5781. you may need to experiment with other camera transformations if you want the y 
  5782. and z vectors to work as POV-Ray does. 
  5783.  
  5784.  
  5785. ΓòÉΓòÉΓòÉ 9. APPENDIX C  Suggested Reading ΓòÉΓòÉΓòÉ
  5786.  
  5787. First, a shameless plug for two books that are specifically about POV-Ray: 
  5788.  
  5789.         The Waite Group's Ray Tracing Creations
  5790.         By Drew Wells & Chris Young
  5791.         ISBN 1-878739-27-1
  5792.         Waite Group Press
  5793.         1993
  5794. and
  5795.         The Waite Group's Image Lab
  5796.         By Tim Wegner
  5797.         ISBN 1-878739-11-5
  5798.         Waite Group Press
  5799.         1992
  5800.  
  5801. Image Lab by Tim Wegner contains a chapter about POV-Ray. Tim is the co- author 
  5802. of the best selling book, Fractal Creations, also from the Waite Group. 
  5803.  
  5804. Ray Tracing Creations by Drew Wells and Chris Young is an entire book about ray 
  5805. tracing with POV-Ray. 
  5806.  
  5807. This section lists several good books or periodicals that you should be able to 
  5808. locate in your local computer book store or your local university library. 
  5809.  
  5810.         "An Introduction to Ray tracing"
  5811.         Andrew S. Glassner (editor)
  5812.         ISBN 0-12-286160-4
  5813.         Academic Press
  5814.         1989
  5815.  
  5816.         "3D Artist" Newsletter
  5817.         ("The Only Newsletter about Affordable
  5818.         PC 3D Tools and Techniques")
  5819.         Publisher: Bill Allen
  5820.         P.O. Box 4787
  5821.         Santa Fe, NM 87502-4787
  5822.         (505) 982-3532
  5823.  
  5824.         "Image Synthesis:  Theory and Practice"
  5825.         Nadia Magnenat-Thalman and Daniel Thalmann
  5826.         Springer-Verlag
  5827.         1987
  5828.  
  5829.         "The RenderMan Companion"
  5830.         Steve Upstill
  5831.         Addison Wesley
  5832.         1989
  5833.  
  5834.         "Graphics Gems"
  5835.         Andrew S. Glassner (editor)
  5836.         Academic Press
  5837.         1990
  5838.  
  5839.         "Fundamentals of Interactive Computer Graphics"
  5840.         J. D. Foley and A. Van Dam
  5841.         ISBN 0-201-14468-9
  5842.         Addison-Wesley
  5843.         1983
  5844.  
  5845.         "Computer Graphics:  Principles and Practice (2nd Ed.)"
  5846.         J. D. Foley, A. van Dam, J. F. Hughes
  5847.         ISBN 0-201-12110-7
  5848.         Addison-Wesley,
  5849.         1990
  5850.  
  5851.         "Computers, Pattern, Chaos, and Beauty"
  5852.         Clifford Pickover
  5853.         St. Martin's Press
  5854.  
  5855.         "SIGGRAPH Conference Proceedings"
  5856.         Association for Computing Machinery
  5857.         Special Interest Group on Computer Graphics
  5858.  
  5859.         "IEEE Computer Graphics and Applications"
  5860.         The Computer Society
  5861.         10662, Los Vaqueros Circle
  5862.         Los Alamitos, CA 90720
  5863.  
  5864.         "The CRC Handbook of Mathematical Curves and Surfaces"
  5865.         David von Seggern
  5866.         CRC Press
  5867.         1990
  5868.  
  5869.         "The CRC Handbook of Standard Mathematical Tables"
  5870.         CRC Press
  5871.         The Beginning of Time
  5872.  
  5873.  
  5874. ΓòÉΓòÉΓòÉ 10. APPENDIX D  Legal Information ΓòÉΓòÉΓòÉ
  5875.  
  5876. The following is legal information pertaining to the use of the Persistence of 
  5877. Vision Ray Tracer a.k.a POV-Ray. It applies to all POV-Ray source files, 
  5878. executable (binary) files, scene files, documentation files contained in the 
  5879. official POV archives.  (Certain portions refer to custom versions of the 
  5880. software,  there are specific rules listed below for these versions also.)  All 
  5881. of these are referred to here as "the software". 
  5882.  
  5883. THIS NOTICE MUST ACCOMPANY ALL OFFICIAL OR CUSTOM PERSISTENCE OF VISION FILES. 
  5884. IT MAY NOT BE REMOVED OR MODIFIED. THIS INFORMATION PERTAINS TO ALL USE OF THE 
  5885. PACKAGE WORLDWIDE.  THIS DOCUMENT SUPERSEDES ALL PREVIOUS LICENSES OR 
  5886. DISTRIBUTION POLICIES. 
  5887.  
  5888.             IMPORTANT LEGAL INFORMATION 
  5889.  
  5890. Permission is granted to the user to use the Persistence of Vision Raytracer 
  5891. and all associated files in this package to create and render images. The use 
  5892. of this software for the purpose of creating images is free. The creator of a 
  5893. scene file and the image created from the scene file, retains all rights to the 
  5894. image and scene file they created and may use them for any purpose commercial 
  5895. or non-commercial. 
  5896.  
  5897. The user is also granted the right to use the scenes files and include files 
  5898. distributed in the INCLUDE and DEMO sub-directories of the POVDOC archive when 
  5899. creating their own scenes.  Such permission does not extend to files in the 
  5900. POVSCN archive.  POVSCN files are for your enjoyment and education but may not 
  5901. be the basis of any derivative works. 
  5902.  
  5903. This software package and all of the files in this archive are copyrighted and 
  5904. may only be distributed and/or modified according to the guidelines listed 
  5905. below.  The spirit of the guidelines below is to promote POV-Ray as a standard 
  5906. ray tracer, provide the full POV-Ray package freely to as many users as 
  5907. possible, prevent POV-Ray users and developers from being taken advantage of, 
  5908. enhance the life quality of those who come in contact with POV-Ray.  This legal 
  5909. document was created so these goals could be realized. You are legally bound to 
  5910. follow these rules, but we hope you will follow them as a matter of ethics, 
  5911. rather than fear of litigation. 
  5912.  
  5913. No portion of this package may be separated from the package and distributed 
  5914. separately other than under the conditions specified in the guidelines below. 
  5915.  
  5916. This software may be bundled in other software packages according to the 
  5917. conditions specified in the guidelines below. 
  5918.  
  5919. This software may be included in software-only compilations using media such 
  5920. as, but not limited to, floppy disk, CD-ROM, tape backup, optical disks, hard 
  5921. disks, or memory cards.  There are specific rules and guidelines listed below 
  5922. for the provider to follow in order to legally offer POV-Ray with a software 
  5923. compilation. 
  5924.  
  5925. The user is granted the privilege to modify and compile the source for their 
  5926. own personal use in any fashion they see fit.  What you do with the software in 
  5927. your own home is your business. 
  5928.  
  5929. If the user wishes to distribute a modified version of the software (here after 
  5930. referred to as a "custom version") they must follow the guidelines listed 
  5931. below.  These guidelines have been established to promote the growth of POV-Ray 
  5932. and prevent difficulties for users and developers alike.  Please follow them 
  5933. carefully for the benefit of all concerned when creating a custom version. 
  5934.  
  5935. You may not incorporate any portion of the POV-Ray source code in any software 
  5936. other than a custom version of POV-Ray.  However authors who contribute source 
  5937. to POV-Ray may still retain all rights to use their contributed code for any 
  5938. purpose as described below. 
  5939.  
  5940. The user is encouraged to send enhancements and bug fixes to the POV-Team, but 
  5941. the team is in no way required to utilize these enhancements or fixes. By 
  5942. sending material to the POV-Team, the contributor asserts that he owns the 
  5943. materials or has the right to distribute these materials.  He authorizes the 
  5944. POV-Team to use the materials any way they like.  The contributor still retains 
  5945. rights to the donated material, but by donating you grant equal rights to the 
  5946. POV-Team.  The POV-Team doesn't have to use the material, but if we do, you do 
  5947. not acquire any rights related to POV- Ray.  We will give you credit if 
  5948. applicable. 
  5949.  
  5950.           GENERAL RULES FOR ALL DISTRIBUTION 
  5951.  
  5952. The permission to distribute this package under certain very specific 
  5953. conditions is granted in advance, provided that the above and following 
  5954. conditions are met. 
  5955.  
  5956. These archives must not be re-archived using a different method without the 
  5957. explicit permission of the POV-Team.  You may rename the archives only to meet 
  5958. the file name conventions of your system or to avoid file name duplications but 
  5959. we ask that you try to keep file names as similar to the originals as possible. 
  5960. (For example: POVDOC.ZIP to POVDOC20.ZIP) 
  5961.  
  5962. You must distribute a full package of archives as described in the next 
  5963. section. 
  5964.  
  5965. Non-commercial distribution (such as a user copying the software for a personal 
  5966. friend or colleague and not charging money or services for that copy) has no 
  5967. other restrictions.  This does not include non-profit organizations or computer 
  5968. clubs. These groups should use the Shareware/Freeware distribution company 
  5969. rules below. 
  5970.  
  5971. The POV-Team reserves the right to withdraw distribution privileges from any 
  5972. group, individual, or organization for any reason. 
  5973.  
  5974.             DEFINITION OF "FULL PACKAGE" 
  5975.  
  5976. POV-Ray is contained in 4 archives for each hardware platform. 
  5977.  
  5978.  1. An executable archive, 
  5979.  
  5980.  2. A documentation archive, 
  5981.  
  5982.  3. Sample scene archives, 
  5983.  
  5984.  4. Source code archive. 
  5985.  
  5986. A "full package" is defined as one of the following bundle options: 
  5987.  
  5988.  1. All archives (executable, docs, scenes, source) 
  5989.  
  5990.  2. User archives (executable, docs, scenes but no source) 
  5991.  
  5992.  3. Programmer archives (source, docs, scenes but no executable) 
  5993.  
  5994. POV-Ray is officially distributed for IBM-PC compatibles running MS-Dos; Apple 
  5995. Macintosh; and Commodore Amiga.  Other systems may be added in the future. 
  5996.  
  5997. Distributors need not support all platforms but for each platform you support 
  5998. you must distribute a full package.  For example an IBM-only BBS need not 
  5999. distribute the Mac versions. 
  6000.  
  6001.        CONDITIONS FOR DISTRIBUTION OF CUSTOM VERSIONS 
  6002.  
  6003. You may distribute custom compiled versions only if you comply with the 
  6004. following conditions. 
  6005.  
  6006. o Mark your version clearly on all modified files stating this to be a modified 
  6007.   and unofficial version. 
  6008.  
  6009. o Make all of your modifications to POV-Ray freely and publicly available. 
  6010.  
  6011. o You must provide all POV-Ray support for all users who use your custom 
  6012.   version.  The POV-Ray Team is not obligated to provide you or your users any 
  6013.   technical support. 
  6014.  
  6015. o You must provide documentation for any and all modifications that you have 
  6016.   made to the program that you are distributing. 
  6017.  
  6018. o Include clear and obvious information on how to obtain the official POV-Ray. 
  6019.  
  6020. o Include contact and support information for your version.  Include this 
  6021.   information in the DISTRIBUTION_MESSAGE macros in the source file FRAME.H and 
  6022.   insure that the program prominently displays this information. Include all 
  6023.   credits and credit screens for the official version. 
  6024.  
  6025. o Include a copy of this document. 
  6026.  
  6027.           CONDITIONS FOR COMMERCIAL BUNDLING 
  6028.  
  6029. Vendors wishing to bundle POV-Ray with commercial software or with publications 
  6030. must first obtain explicit permission from the POV-Ray Team. This includes any 
  6031. commercial software or publications, such as, but not limited to, magazines, 
  6032. books, newspapers, or newsletters in print or machine readable form. 
  6033.  
  6034. The POV-Ray Team will decide if such distribution will be allowed on a 
  6035. case-by-case basis and may impose certain restrictions as it sees fit.  The 
  6036. minimum terms are given below. Other conditions may be imposed. 
  6037.  
  6038. o Purchasers of your product must not be led to believe that they are paying 
  6039.   for POV-Ray.  Any mention of the POV-Ray bundle on the box, in advertising or 
  6040.   in instruction manuals must be clearly marked with a disclaimer that POV-Ray 
  6041.   is free software and can be obtained for free or nominal cost from various 
  6042.   sources. 
  6043.  
  6044. o Include clear and obvious information on how to obtain the official POV-Ray. 
  6045.  
  6046. o Include a copy of this document. 
  6047.  
  6048. o You must provide all POV-Ray support for all users who acquired POV- Ray 
  6049.   through your product.  The POV-Ray Team is not obligated to provide you or 
  6050.   your customers any technical support. 
  6051.  
  6052. o Include a credit page or pages in your documentation for POV-Ray. 
  6053.  
  6054. o If you modify any portion POV-Ray for use with your hardware or software, you 
  6055.   must follow the custom version rules in addition to these rules. 
  6056.  
  6057. o Include contact and support information for your product. 
  6058.  
  6059. o Must include official documentation with product. 
  6060.  
  6061.      CONDITIONS FOR SHAREWARE/FREEWARE DISTRIBUTION COMPANIES 
  6062.  
  6063. Shareware and freeware distribution companies may distribute the archives under 
  6064. the conditions following this section. 
  6065.  
  6066. You must notify us that you are distributing POV-Ray and must provide us with 
  6067. information on how to contact you should any support issues arise. 
  6068.  
  6069. No more than five dollars U.S. ($5) can be charged per disk for the copying of 
  6070. this software and the media it is provided on. Space on each disk must used 
  6071. completely.  The company may not put each archive on a separate disk and charge 
  6072. for three disks if all three archives will fit on one disk. If more than one 
  6073. disk is needed to store the archives then more than one disk may be used and 
  6074. charged for. 
  6075.  
  6076. Distribution on high volume media such as backup tape or CD-ROM is permitted if 
  6077. the total cost to the user is no more than $0.10 per megabyte of data.  For 
  6078. example a CD-ROM with 600 meg could cost no more than $60.00. 
  6079.  
  6080.          CONDITIONS FOR ON-LINE SERVICES AND BBS'S 
  6081.  
  6082. On-line services and BBS's may distribute the POV-Ray archives under the 
  6083. conditions following this section. 
  6084.  
  6085. The archives must be all be easily available on the service and should be 
  6086. grouped together in a similar on-line area. 
  6087.  
  6088. It is strongly requested that BBS operators remove prior versions of POV- Ray 
  6089. to avoid user confusion and simplify or minimize our support efforts. 
  6090.  
  6091. The on-line service or BBS may only charge standard usage rates for the 
  6092. downloading of this software. A premium may not be charged for this package. 
  6093. I.E. CompuServe or America On-Line may make these archives available to their 
  6094. users, but they may only charge regular usage rates for the time required to 
  6095. download. They must also make the all of the archives available in the same 
  6096. forum, so they can be easily located by a user. 
  6097.  
  6098.                 DISCLAIMER 
  6099.  
  6100. This software is provided as is without any guarantees or warranty. Although 
  6101. the authors have attempted to find and correct any bugs in the package, they 
  6102. are not responsible for any damage or losses of any kind caused by the use or 
  6103. misuse of the package. The authors are under no obligation to provide service, 
  6104. corrections, or upgrades to this package. 
  6105.  
  6106.  
  6107. ΓòÉΓòÉΓòÉ 11. APPENDIX E  Contacting The Authors ΓòÉΓòÉΓòÉ
  6108.  
  6109. We love to hear about how you're using and enjoying the program. We also will 
  6110. do our best try to solve any problems you have with POV-Ray and incorporate 
  6111. good suggestions into the program. 
  6112.  
  6113. If you have a question regarding commercial use of, distribution of, or 
  6114. anything particularly sticky, please contact Chris Young, the development team 
  6115. coordinator. Otherwise, spread the mail around. We all love to hear from you! 
  6116.  
  6117. The best method of contact is e-mail through CompuServe for most of us. America 
  6118. On-Line and Internet can now send mail to CompuServe, also, just use the 
  6119. Internet address and the mail will be sent through to CompuServe where we read 
  6120. our mail daily. 
  6121.  
  6122. Please do not send large files to us through the e-mail without asking first. 
  6123. We pay for each minute on CompuServe and large files can get expensive. Send a 
  6124. query before you send the file, thanks! 
  6125.  
  6126.         Chris Young
  6127.         (Team Coordinator. Worked on everything.)
  6128.         CIS: 76702,1655
  6129.         Internet 76702.1655@compuserve.com
  6130.         US Mail:
  6131.           3119 Cossell Drive
  6132.           Indianapolis, IN 46224 U.S.A.
  6133.  
  6134.         Drew Wells
  6135.         (Former team leader. Worked on everything.)
  6136.         CIS: 73767,1244
  6137.         Internet: 73767.1244@compuserve.com
  6138.         AOL: Drew Wells
  6139.         Prodigy: SXNX74A (Not used often)
  6140.  
  6141. Other authors and contributors in alphabetical order:
  6142. -----------------------------------------------------
  6143.         David Buck
  6144.         (Original author of DKBTrace)
  6145.         (Primary developer, quadrics, docs)
  6146.         INTERNET: (preferred) dbuck@ccs.carleton.ca
  6147.         CIS: 70521,1371
  6148.  
  6149.         Aaron Collins
  6150.         (Co-author of DKBTrace 2.12)
  6151.         (Primary developer, IBM-PC display code,phong)
  6152.         CIS: 70324,3200
  6153.  
  6154.         Alexander Enzmann
  6155.         (Primary developer, Blobs, quartics, boxes, spotlights)
  6156.         CIS: 70323,2461
  6157.         INTERNET: xander@mitre.com
  6158.  
  6159.         Dan Farmer
  6160.         (Primary developer, docs, scene files)
  6161.         CIS:70703,1632
  6162.  
  6163.         Douglas Muir
  6164.         (Bump maps and height fields)
  6165.         CIS: 76207,662
  6166.         Internet: dmuir@media-lab.media.mit.edu
  6167.  
  6168.         Bill Pulver
  6169.         (Time code and IBM-PC compile)
  6170.         CIS: 70405,1152
  6171.         AOL: BPulver
  6172.  
  6173.         Charles Marslette
  6174.         (IBM-PC display code)
  6175.         CIS: 75300,1636
  6176.  
  6177.         Mike Miller
  6178.         (Artist, scene files, stones.inc)
  6179.         CIS: 70353,100
  6180.  
  6181.         Jim Nitchals
  6182.         (Mac version, scene files)
  6183.         CIS: 73117,3020
  6184.         AppleLink: jimn8
  6185.         Internet: 73117.3020@compuserve.com
  6186.  
  6187.         Eduard Schwan
  6188.         (Mac version, docs)
  6189.         CIS: 71513,2161
  6190.         AppleLink: JL.Tech
  6191.         Internet: 71513.2161@compuserve.com
  6192.  
  6193.         Randy Antler
  6194.         (IBM-PC display code enhancements)
  6195.         CIS: 71511,1015
  6196.  
  6197.         David Harr
  6198.         (Mac balloon help)
  6199.         CIS: 72117,1704
  6200.  
  6201.         Scott Taylor
  6202.         (Leopard and Onion textures)
  6203.         CIS: 72401,410
  6204.  
  6205.         Chris Cason
  6206.         (colour X-Windows display code)
  6207.         CIS: 100032,1644
  6208.  
  6209.         Dave Park
  6210.         (Amiga support; added AGA video code)
  6211.         CIS: 70004,1764
  6212.