grecomoran

POV-Ray 2.2 Manual

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