home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / PPC Application / POV-Ray 3 Templates < prev    next >
Encoding:
Text File  |  1997-06-02  |  50.1 KB  |  1,756 lines  |  [TEXT/R*ch]

  1. @com.POV-Ray 3 Macintosh Template file
  2. @com.Version: 3.0.2 beta 1
  3. @com. **** NOTE: Look for "FIXME" string for incomplete sections ****
  4. @com.Last Modified:
  5. @com.   [esp] September 27, 1995
  6. @com.   [anr] December 28, 1995
  7. @com.   [esp] March 18, 1996
  8. @com.   [Matt Kruse] April 9, 1996 <mkruse@demian.sau.edu> a few tweaks
  9. @com.   [esp] 961021 fixed irid and additional includes
  10. @com.   [anr] Januari 29, 1997
  11. @com.   [anr] June 2, 1997 fixed #switch
  12. @com.------------------------------------------------------------
  13. @com.
  14. @com.============================================================
  15. @mt1.Headers
  16. @com.============================================================
  17. @com.
  18. @com.------------------------------
  19. @mt2.Scene File Header
  20. // Persistence of Vision Ray Tracer Scene Description File
  21. // File: .pov
  22. // Vers: 3
  23. // Desc: 
  24. // Date: 
  25. // Auth: 
  26.  
  27. @com.------------------------------
  28. @mt2.Standard includes
  29. // ==== Standard POV-Ray Includes ====
  30. #include "colors.inc"    // Standard Color definitions
  31. #include "textures.inc"    // Standard Texture definitions
  32.  
  33. @com.------------------------------
  34. @mt2.Additional includes
  35. // ==== Additional Includes ====
  36. // Don't have all of the following included at once, it'll cost memory and time
  37. // to parse!
  38. #include "CHARS.INC"    // A complete library of character objects, by Ken Maeno
  39. #include "CONSTS.INC"   // Various constants and alias definitions
  40. #include "FINISH.INC"   // Some basic finishes
  41. #include "GLASS.INC"    // Glass textures
  42. #include "GOLDS.INC"    // Gold textures
  43. #include "METALS.INC"   // Metallic pigments, finishes, and textures
  44. #include "RAD_DEF.INC"  // Some common radiosity settings
  45. #include "SHAPES.INC"   // Standard objects from POV-Ray's earlier days
  46. #include "SHAPES2.INC"  // Useful, but seldom used shapes
  47. #include "SHAPESQ.INC"  // Pre-defined quartic shapes
  48. #include "SKIES.INC"    // Ready defined sky spheres
  49. #include "STONES.INC"   // Binding include-file for STONES1 and STONES2
  50. #include "STONES1.INC"  // Great stone-textures created by Mike Miller
  51. #include "STONES2.INC"  // More, done by Dan Farmer and Paul Novak
  52. #include "WOODMAPS.INC" // Basic wooden colormaps
  53. #include "WOODS.INC"    // Great wooden textures created by Dan Farmer and Paul Novak
  54.  
  55. @com.============================================================
  56. @mt1.Statements
  57. @com.============================================================
  58. @com.
  59. @com.------------------------------
  60. @mt2.background
  61. // Set a color of the background (sky)
  62. background { color red 0.1 green 0.3 blue 0.8 }
  63. @com.------------------------------
  64. @mt2.Typical camera
  65. camera
  66. {
  67.   location  <0.0 , 2.0 ,-5.0>
  68.   look_at   <0.0 , 0.0 , 0.0>
  69. }
  70. @mt2.Camera definition
  71. // set viewer's position in the scene
  72. camera
  73. {
  74. // (camera types)
  75. //  perspective (default) | orthographic | fisheye |
  76. //  ultra_wide_angle | omnimax | panoramic | cylinder 1
  77.   location  <0.0, 1.0, -6.0> // position of camera <X Y Z>
  78.   direction 2.0*z            // which way are we looking <X Y Z> & zoom
  79. //  sky       y                // rarely used
  80.   up        y                // which way is +up <X Y Z>
  81.   right     4/3*x            // which way is +right <X Y Z> and aspect ratio
  82.   look_at   <0.0, 0.0,  0.0> // point center of view at this point <X Y Z>
  83. //  angle FLOAT                // overrides "direction" with specific angle
  84. //  normal { ripples 0.2 }     // perturb the camera lens with a pattern
  85. // (focal blur extras)
  86. //  aperture 0.2               // 0...N (bigger is narrower depth of field)
  87. //  blur_samples 4             // # of rays per pixel
  88. //  focal_point <VECTOR>       // x,y,z point that is in focus
  89. }
  90. @com.------------------------------
  91. @mt2.Ambient fog
  92. fog
  93. {
  94.   fog_type 1
  95.   distance 100
  96.   color SkyBlue
  97. }
  98. @mt2.Ground fog
  99. fog
  100. {
  101.   fog_type   1
  102.   distance   10
  103.   color      Gray
  104.   fog_offset 0.1
  105.   fog_alt    0.2
  106.   turbulence 0.8
  107. }
  108. @mt2.Fog definition
  109. //FIXME
  110. // set global atmospheric fog effect in the scene.
  111. // at the fog distance, there will be 63% visibility
  112.   fog {
  113.     fog_type 1 // 1=constant, 2=ground_fog
  114.     distance 10
  115.     color Gray
  116. // turbulence <TURBULENCE>
  117. // turb_depth TURB_DEPTH
  118. // omega OMEGA
  119. // lambda LAMBDA
  120. // octaves OCTAVES
  121. // fog_offset FOG_OFFSET
  122. // fog_alt FOG_ALT
  123.   }
  124. @com.------------------------------
  125. @mt2.Rainbow
  126. //FIXME
  127.   rainbow {
  128.     direction <DIR>
  129.     angle ANGLE
  130.     width WIDTH
  131.     distance DISTANCE
  132.     color_map { COLOUR_MAP }
  133.     [ jitter JITTER ]
  134.     [ up <UP> ]
  135.     [ arc_angle ARC_ANGLE ]
  136.     [ falloff_angle FALLOFF_ANGLE ]
  137.   }
  138. @com.------------------------------
  139. @mt2.Sky Sphere
  140. // Create an infinite sphere around scene and allow any texture on it
  141. sky_sphere
  142. {
  143.   pigment
  144.   {
  145.     gradient y
  146.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  147.   }
  148. }
  149. @com.------------------------------
  150. @mt2.adc
  151. global_settings { adc_bailout 20 }
  152. @com.------------------------------
  153. @mt2.assumed gamma
  154. global_settings { assumed_gamma 1.0 }
  155. @com.------------------------------
  156. @mt2.HFGray16
  157. global_settings { HF_Gray_16 }
  158. @com.------------------------------
  159. @mt2.irid_wavelength
  160. global_settings { irid_wavelength <0.25, 0.18, 14> }
  161. @com.------------------------------
  162. @mt2.max_trace_level
  163. global_settings { max_trace_level 20 }
  164. @com.------------------------------
  165. @mt2.max_intersections
  166. global_settings { max_intersections 200 }
  167. @com.------------------------------
  168. @mt2.number_of_waves
  169. global_settings { number_of_waves 10 }
  170. @com.------------------------------
  171. @mt2.ambient light
  172. global_settings { ambient_light { color <COLOR> } }
  173. @com.------------------------------
  174. @mt2.max_intersections
  175. // set the maximum ray tracing intersection depth (1...200) [64]
  176. #max_intersections 64
  177. @com.------------------------------
  178. @mt2.max_trace_level
  179. // set the maximum ray tracing bounce depth (1...20) [5]
  180. #max_trace_level 5
  181. @com.------------------------------
  182. @mt2.version
  183. // Set the language version of POV-Ray.  Enables or
  184. // disables syntax features that are version-dependent.
  185. // e.g. #version 1.0, or #version 2.0, etc.
  186. // (Note: This can toggle versions anywhere in the source)
  187. #version 2.0  // use POV-Ray 2.0 syntax
  188. @com.
  189. @com.============================================================
  190. @mt1.Animation
  191. @com.============================================================
  192. @com.
  193. @com.------------------------------
  194. @mt2.clock
  195. // FIXME-fill in an example with clock
  196. @com.
  197. @com.============================================================
  198. @mt1.Expressions
  199. @com.============================================================
  200. @com.
  201. @com.------------------------------
  202. @mt2.Built-in Ids
  203. // These identifiers are built in to POV-Ray, ready to use
  204. //  #declare pi = 3.1415926535897932384626
  205. //  #declare true = 1
  206. //  #declare yes = 1
  207. //  #declare on = 1
  208. //  #declare false = 0
  209. //  #declare no = 0
  210. //  #declare off = 0
  211. //  #declare u = <1,0>
  212. //  #declare v = <0,1>
  213. //  #declare x = <1,0,0>
  214. //  #declare y = <0,1,0>
  215. //  #declare z = <0,0,1>
  216. //  #declare t = <0,0,0,1>
  217. @com.------------------------------
  218. @mt2.Math Operators
  219. //   ()   * /   + -   !
  220. #declare MyResult = -2*B + (A*A - 4)
  221. @mt2.Relational Operators
  222. // Relationals must be within parentheses
  223. // Return arithmetic value 0 for false or 1 for true
  224. //   <  <=  =  !=  >=  >
  225. #declare BallColor = pigment { red (clock > 0.5) } // black or red
  226. @com.------------------------------
  227. @mt2.Vector components
  228. // extract each component of a vector:
  229. // #if (MyVector.x > 5) ...
  230. // #if (MyVector.y > 5) ...
  231. // #if (MyVector.z > 5) ...
  232. // #if (MyVector.t > 5) ...
  233. @com.------------------------------
  234. @mt2.Strings
  235. /* various string operations
  236. asc(S1) // Convert 1st character of S1 to ASCII value
  237. chr(A) // Convert extended ASCII value A to a 1 character string
  238. concat(S1,S2) // combine S1 and S2 into one long string
  239. file_exists(S1): Search current and include directories for existence of file S1 (0 or 1)
  240. str(A,L,P) // Convert float A to string, at least L characters long,
  241.            // with P digits after the decimal point (if P is -1, make max)
  242. strcmp(S1,S2) // compare S1 to S2, return -1, 0, or +1 if S2 is <, =, > than S1
  243. strlen(S1) // Returns # of characters in string S1
  244. strlwr(S1) // Lower case of S1
  245. substr(S1,P,L) // Sub-string from S1, start at position P for length L
  246. strupr(S1) // Upper case of S1
  247. val(S1) // Convert string S1 to float
  248. // some special control characters that can be used within strings
  249.   "\a" Bell or alarm, 0x07
  250.   "\b" Backspace, 0x08
  251.   "\f" Form feed, 0x0C
  252.   "\n" New line (line feed) 0x0A
  253.   "\r" Carriage return 0x0D
  254.   "\t" Horizontal tab 0x09
  255.   "\v" Vertical tab 0x0B
  256.   "\0" Null 0x00
  257.   "\\" Backslash 0x5C
  258.   "\'" Single quote 0x27
  259. */
  260. @com.
  261. @com.============================================================
  262. @mt1.Light sources
  263. @com.============================================================
  264. @com.
  265. @com.------------------------------
  266. @mt2.Point light
  267. // create a regular point light source
  268. light_source
  269. {
  270.   0*x // light's position (translated below)
  271.   color red 1.0  green 1.0  blue 1.0  // light's color
  272.   translate <-20, 40, -20>
  273. }
  274. @com.------------------------------
  275. @mt2.Spotlight
  276. // create a point "spotlight" (conical directed) light source
  277. light_source
  278. {
  279.   0*x                     // light's position (translated below)
  280.   color rgb <1,1,1>       // light's color
  281.   spotlight               // this kind of light source
  282.   translate <40, 80, -40> // <x y z> position of light
  283.   point_at <0, 0, 0>      // direction of spotlight
  284.   radius 5                // hotspot (inner, in degrees)
  285.   tightness 50            // tightness of falloff (1...100) lower is softer, higher is tighter
  286.   falloff 8               // intensity falloff radius (outer, in degrees)
  287. }
  288. @com.------------------------------
  289. @mt2.Cylindrical light
  290. // create a point "spotlight" (cylindrical directed) light source
  291. light_source
  292. {
  293.   0*x                     // light's position (translated below)
  294.   color rgb <1,1,1>       // light's color
  295.   spotlight               // this kind of light source
  296.   cylinder                // this variation
  297.   translate <40, 80, -40> // <x y z> position of light
  298.   point_at <0, 0, 0>      // direction of spotlight
  299.   radius 5                // hotspot (inner, in degrees)
  300.   tightness 50            // tightness of falloff (1...100) lower is softer, higher is tighter
  301.   falloff 8               // intensity falloff radius (outer, in degrees)
  302. }
  303. @com.------------------------------
  304. @mt2.looks_like
  305. // light_source { ...
  306.   // put this inside a light_source to give it a visible appearance
  307.   looks_like { sphere { 0*x, 5 pigment { Yellow } } }
  308. @com.------------------------------
  309. @mt2.area light
  310. // An area light (creates soft shadows)
  311. // WARNING: This special light can significantly slow down rendering times!
  312. light_source
  313. {
  314.   0*x // light's position (translated below)
  315.   color rgb 1.0  // light's color
  316.   // <widthVector> <heightVector> nLightsWide mLightsHigh
  317.   area_light
  318.   <8, 0, 0> <0, 0, 8> // lights spread out across this distance (x * z)
  319.   4, 4                // total number of lights in grid (4x*4z = 16 lights)
  320.   adaptive 0          // 0,1,2,3... 
  321.   jitter              // adds random softening of light
  322.   translate <40, 80, -40>   // <x y z> position of light
  323. }
  324. @com.------------------------------
  325. @mt2.light definition
  326. /*
  327. light_source
  328. {
  329.     <CENTER>
  330.     color <COLOUR>
  331.     [ spotlight ]
  332.     [ cylinder ]
  333.     [ point_at <POINT> ]
  334.     [ radius RADIUS ]
  335.     [ falloff FALLOFF ]
  336.     [ tightness TIGHTNESS ]
  337.     [ area_light <AXIS1>, <AXIS2>, SIZE1, SIZE2 ]
  338.     [ adaptive ADAPTIVE ]
  339.     [ jitter JITTER ]
  340.     [ looks_like { OBJECT } ]
  341.     [ fade_distance FADE_DISTANCE ]
  342.     [ fade_power FADE_POWER (1...2) ]
  343.     [ atmospheric_attenuation BOOL ]
  344.     [ shadowless ]
  345. }
  346. */
  347. @com.
  348. @com.============================================================
  349. @mt1.Misc. Directives
  350. @com.============================================================
  351. @com.
  352. @com.------------------------------
  353. @mt2.atmosphere
  354. //FIXME
  355. /*
  356.   #declare ISOTROPIC_SCATTERING         = 1
  357.   #declare MIE_HAZY_SCATTERING          = 2
  358.   #declare MIE_MURKY_SCATTERING         = 3
  359.   #declare RAYLEIGH_SCATTERING          = 4
  360.   #declare HENYEY_GREENSTEIN_SCATTERING = 5
  361.   atmosphere {
  362.     type SCATTERING_TYPE
  363.     distance DISTANCE
  364.     [ scattering SCATTERING ]
  365.     [ eccentricity ECCENTRICITY ]
  366.     [ samples SAMPLES ]
  367.     [ jitter JITTER ]
  368.     [ aa_threshold AA_THRESHOLD ]
  369.     [ aa_level AA_LEVEL ]
  370.     [ color <COLOUR> ]
  371.   }
  372. */
  373. // Atmosphere with Mie scattering, murky atmosphere (dependent on incident light). 
  374. atmosphere
  375. {
  376.   type 3            // Mie scattering
  377.   samples 20        // Number of samples in first distance interval
  378.   distance 20       // Atmosphere density, similar to fog
  379.   scattering 1.5    // Reflectivity of atmosphere, determines brightness
  380.   aa_level 8        // Level of binary subdivision in case of aa
  381.   aa_threshold 0.1  // Threshold for aa to push in
  382.   jitter 0.2        // Amount of sample jittering
  383. }
  384. @com.------------------------------
  385. @mt2.declare
  386. #declare MyColor = color red 0.7 green 0.5 blue 0.3
  387. @com.------------------------------
  388. @mt2.default
  389. // sets the default texture that objects get when they have no texture specified
  390. #default
  391. {
  392.   texture { pigment {color red 1} finish{ambient 0.2} }
  393. }
  394. @com.------------------------------
  395. @mt2.if
  396. #if (expr)
  397.  
  398. #else
  399.  
  400. #end
  401. @com.------------------------------
  402. @mt2.if example
  403.   #if (High_Quality)
  404.     // This section is parsed if High_Quality is true
  405.   #end // End of conditional part
  406. // or you can use the else clause too
  407.   #if (clock > 2)
  408.     // This section is parsed if clock is > 2
  409.   #else
  410.     // This section is parsed if clock is <= 2
  411.   #end // End of conditional part
  412. @com.------------------------------
  413. @mt2.ifdef
  414. #ifdef (ident)
  415.  
  416. #else
  417.  
  418. #end
  419. @com.------------------------------
  420. @mt2.ifdef example
  421.   #ifdef (SphereFlake_Shape)
  422.     // This section is  parsed if SphereFlake_Shape is declared
  423.   #else
  424.     // This section is  parsed if SphereFlake_Shape is NOT declared
  425.     #declare SphereFlake_Shape = sphere {0,1} // make a default shape
  426.   #end // End of conditional part
  427. @com.------------------------------
  428. @mt2.switch
  429. #switch (expr)
  430.   #case (expr)
  431.   #break
  432.   #range (expr,expr)
  433.   #break
  434.   #else
  435. #end
  436. @com.------------------------------
  437. @mt2.switch example
  438. // Let's make some constant names
  439. #declare CS_Easy   = 1
  440. #declare CS_Medium = 3
  441. #declare CS_Hard   = 5
  442.  
  443. // Let the user choose the method to use
  444. #declare Complexity_Switch = CS_Medium // or CS_Easy or CS_Hard
  445.  
  446. // Do something dependent on the user's choice
  447. #switch (Complexity_Switch)
  448.   #case (CS_Easy)
  449.   // This statement is done if (Complexity_Switch = CS_Easy)
  450.   #declare MyShape = box{-1,+1}
  451.   #break // end of CS_Easy
  452.   #case (CS_Medium, CS_Hard)
  453.   // This statement is done if Complexity_Switch is CS_Medium
  454.   // or CS_Hard or anything in between
  455.   #declare MyShape = torus{1, 0.5}
  456.   #break // end of CS_Hard
  457.   #else
  458.   // This statement is done if none of the above match
  459.   #declare MyShape = sphere{0,1}
  460. #end
  461. @com.------------------------------
  462. @mt2.while
  463. // Create 10 balls along X axis, from 0 to 9
  464. #declare BallCount = 0
  465. #while (BallCount < 10)
  466.   sphere
  467.   {
  468.     <BallCount,0,0>,  // NOTE: <0,0,0>, <1,0,0>, <2,0,0>, etc.
  469.     0.5
  470.   }
  471.   #declare BallCount = BallCount+1 // increment our counter
  472. #end
  473. @com.------------------------------
  474. @mt2.Messages
  475.   #debug      "During scene parsing, general info message"
  476.   #fatal      "During scene parsing, display and force POV-Ray to stop"
  477.   #render     "After scene parsing, about to render"
  478.   #statistics "After scene frame is rendered"
  479.   #warning    "During scene parsing"
  480. #end
  481. @com.------------------------------
  482. @mt2.version
  483. #declare Temp_Vers = version    // Save original value of #version
  484. #version 2.0                    // Change to 1.0 mode
  485. // Version 2.0 stuff goes here ...
  486. #version Temp_Vers              // Restore original #version value
  487. @com.
  488. @com.============================================================
  489. @mt1.Shapes
  490. @com.============================================================
  491. @com.
  492. @com.------------------------------
  493. @mt2.bicubic_patch
  494. // 3D curved FINITE (no CSG) surface created from a mesh of triangles
  495. bicubic_patch
  496. {
  497.   type 1 // patch_type (0..1)
  498.   // 0 = Bezier patch, just store the triangular vertices
  499.   // 1 = Bezier patch, store all plane equations defined by
  500.   //       the triangulation of the patch into sub patches
  501.   //       (faster, uses more memory)
  502.    flatness 0.1 // flatness value
  503.   //       flatness_value = 0.0 to 1.0, with higher values
  504.   //        giving flatter, less smooth results
  505.   u_steps 3 // # of triangles to subdivide (1-5)
  506.   v_steps 3 // # of triangles to subdivide (1-5)
  507.   <0, 0, 2> <1, 0, 0> <2, 0, 0> <3, 0, -2>
  508.   <0, 1, 0> <1, 1, 0> <2, 1, 0> <3, 1,  0>
  509.   <0, 2, 0> <1, 2, 0> <2, 2, 0> <3, 2,  0>
  510.   <0, 3, 2> <1, 3, 0> <2, 3, 0> <3, 3, -2>
  511. }
  512. @com.------------------------------
  513. @mt2.box
  514. // create a box that extends between the 2 specified points
  515. box
  516. {
  517.   <-1, -1, -1>  // one corner position <X1 Y1 Z1>
  518.   < 1,  1,  1>  // other corner position <X2 Y2 Z2>
  519. }
  520. @com.------------------------------
  521. @mt2.blob
  522. // create a smooth blobby shape
  523. #declare StrengthVal = 1.0 // (+ or -) strength of component's radiating density
  524. #declare RadiusVal   = 1.0 // (0 < RadiusVal) outer sphere of influence on other components
  525. blob
  526. {
  527.   // threshold (0.0 < threshold <= StrengthVal) surface falloff threshold #
  528.   threshold 0.6
  529.   sphere { < 0.75,   0,    0>, StrengthVal, RadiusVal }
  530.   sphere { <-0.375,  0.65, 0>, StrengthVal, RadiusVal }
  531.   sphere { <-0.375, -0.65, 0>, StrengthVal, RadiusVal }
  532.   cylinder { -z, +z, 0.1, StrengthVal, RadiusVal }
  533.   // [sturm]
  534.   scale 2
  535. }
  536. @com.------------------------------
  537. @mt2.cone
  538. // clipped conical shape
  539. // cone { <END1>, RADIUS1, <END2>, RADIUS2 [open] }
  540. // Where <END1> and <END2> are vectors defining the x,y,z
  541. // coordinates of the center of each end of the cone
  542. // and RADIUS1 and RADIUS2 are float values for the radii
  543. // of those ends.  open, if present, cone is hollow, else capped
  544. cone
  545. {
  546.   1*y,  0.0,
  547.   -1*y, 1.0
  548.   // open
  549. }
  550. @com.------------------------------
  551. @mt2.cubic
  552. // create a 3rd order infinite polynomial surface
  553. cubic
  554. {
  555.   <
  556. // x^3,      x^2y,     x^2z,     x^2,
  557.    0,        0,        0,        0,
  558. // xy^2,     xyz,      xy,       xz^2,
  559.    0,        0,        0,        0,
  560. // xz,       x,        y^3,      y^2z,
  561.    0,        0,        0,        0,
  562. // y^2,      yz^2,     yz,       y,
  563.    0,        0,        0,        0,
  564. // z^3,      z^2,      z,        C
  565.    0,        0,        0,        0
  566.   >
  567.   sturm // optional, slower but reduces speckles
  568. }
  569.  
  570. @mt2.cylinder
  571. // Capped Cylinder, closed [or open ended]
  572. // cylinder { <END1>, <END2>, RADIUS [open] }
  573. //  END1 = coord of one end of cylinder
  574. //  END2 = coord of other end
  575. // RADIUS = size of cylinder
  576. // open = if present, cylinder is hollow, else capped
  577. cylinder
  578. {
  579.   0*x,  3*x,  1
  580.   // open
  581. }
  582. @com.------------------------------
  583. @mt2.disc
  584. // flat circular FINITE (no CSG) shape, center hole cutout is optional
  585. disc
  586. {
  587.   <0, 1, 0>  // center position
  588.   z,         // normal vector
  589.   1.0,       // outer radius
  590.   0.2        // optional hole radius
  591. }
  592. @com.------------------------------
  593. @mt2.fractal
  594. // create a 3-D slice of a 4-D julia fractal object
  595. julia_fractal
  596.   <-0.083,0.0,-0.83,-0.025> 
  597.   quaternion // hypercomplex?
  598.   cube // TYPE: sqr cube 
  599.   max_iteration 8 
  600.   precision 20 // 10...500? FIXME
  601.   //  slice xx?
  602.  }
  603. @com.------------------------------
  604. @mt2.height_field
  605. // uses image color index as height, extends along X-Z axes
  606. // from <0 0 0> to <1 1 1>
  607. height_field
  608. {
  609.   gif               // the file type to read (gif/tga/pot/pgm/ppm/png/sys)
  610.   "plasma3.gif"     // the file name to read
  611. //  inverse | texture {...}
  612. //  [smooth]        // make smoother surface
  613. //  [water_level N] // truncate/clip below N (0.0 ... 1.0)
  614. // translate VECTOR | rotate VECTOR | scale VECTOR
  615. }
  616. @com.------------------------------
  617. @mt2.height_field+imagemap
  618. // uses image color index as height, extends along X-Z axes
  619. // from <0 0 0> to <1 1 1>
  620. height_field
  621. {
  622.   gif "plasma3.gif"
  623.   texture
  624.   {
  625.     pigment
  626.     {
  627.       image_map { gif "plasma3.gif" map_type 0 interpolate 2 once }
  628.       rotate x*90 // lay X-Y image map down onto X-Z height field plane
  629.     }
  630.   }
  631. }
  632. @com.------------------------------
  633. @mt2.lathe
  634. // rotate a 2-D outline of points around the Y axis to create a 3-D shape
  635. lathe {
  636.   linear_spline // linear_spline | quadratic_spline | cubic_spline
  637.   5, // number of points
  638.   <2, 0>, <3, 0>, <3, 5>, <2, 5>, <2, 0> // the list of <u,v> points
  639. }
  640. @com.------------------------------
  641. @mt2.mesh
  642. // triangle or smooth-triangle mesh FINITE (no CSG) shape
  643. // NOTE: Each triangle can be independently textured,
  644. //       remaining triangles get texture at bottom
  645. mesh // box example here
  646. {
  647.   /* top side */
  648.   triangle { <-2, 2, -2>, <2, 2, -2>, <2, 2, 2> texture { Red } }
  649.   triangle { <-2, 2, -2>, <-2, 2, 2>, <2, 2, 2> texture { Red } }
  650.   /* bottom side */
  651.   triangle { <-2, -2, -2>, <2, -2, -2>, <2, -2, 2> }
  652.   triangle { <-2, -2, -2>, <-2, -2, 2>, <2, -2, 2> }
  653.   /* left side */
  654.   triangle { <-2, -2, -2>, <-2, -2, 2>, <-2, 2, 2> }
  655.   triangle { <-2, -2, -2>, <-2, 2, -2>, <-2, 2, 2> }
  656.   /* right side */
  657.   triangle { <2, -2, -2>, <2, -2, 2>, <2, 2, 2> texture { Green } }
  658.   triangle { <2, -2, -2>, <2, 2, -2>, <2, 2, 2> texture { Green } }
  659.   /* front side */
  660.   triangle { <-2, -2, -2>, <2, -2, -2>, <-2, 2, -2> texture { Blue } }
  661.   triangle { <-2, 2, -2>, <2, 2, -2>, <2, -2, -2> texture { Blue } }
  662.   /* back side */
  663.   triangle { <-2, -2, 2>, <2, -2, 2>, <-2, 2, 2> }
  664.   triangle { <-2, 2, 2>, <2, 2, 2>, <2, -2, 2> }
  665.   texture
  666.   { // remaining triangles get this texture
  667.     pigment { color rgb<0.9, 0.9, 0.9> }
  668.     finish { ambient 0.2 diffuse 0.7 }
  669.   }
  670. }
  671. @com.------------------------------
  672. @mt2.object
  673. // general purpose enclosing wrapper for a predefined shape
  674. #define MyShape = box {-1,1}     // define the shape
  675. object { MyShape }               // create an actual object with that shape
  676. object { MyShape translate 3*x}  // create another object with that shape
  677. @com.------------------------------
  678. @mt2.plane
  679. // An infinite planar surface
  680. // plane {<A, B, C>, D } where: A*x + B*y + C*z = D
  681. plane
  682. {
  683.   y, // <X Y Z> unit surface normal, vector points "away from surface"
  684.   -1.0 // distance from the origin in the direction of the surface normal
  685. }
  686. @com.------------------------------
  687. @mt2.polygon
  688. // arbitrary X,Y FINITE (no CSG) shape
  689. // A complex example for a polygon is the letter "P":
  690. polygon
  691. {
  692.   12, // number of points
  693.   <0, 0>, <0, 6>, <4, 6>, <4, 3>, <1, 3>, <1, 0>, <0, 0>, // list of <u,v> points
  694.   <1, 4>, <1, 5>, <3, 5>, <3, 4>, <1, 4>
  695. }
  696. @com.------------------------------
  697. @mt2.polynomial
  698. // create an Nth order infinite polynomial surface
  699. // poly { N <a,b,c...> [sturm] }
  700. // N = order of poly, M terms where M = (N+1)*(N+2)*(N+3)/6
  701. poly
  702. {
  703.   5, // order of polynomial (2...7)
  704.   <
  705. // x^5,        x^4y,       x^4z,       x^4,
  706.    0,          0,          0,          0,
  707. // x^3y^2,     x^3yz,      x^3y,       x^3z^2,
  708.    0,          0,          0,          0,
  709. // x^3z,       x^3,        x^2y^3,     x^2y^2z,
  710.    0,          0,          0,          0,
  711. // x^2y^2,     x^2yz^2,    x^2yz,      x^2y,
  712.    0,          0,          0,          0,
  713. // x^2z^3,     x^2z^2,     x^2z,       x^2,
  714.    0,          0,          0,          0,
  715. // xy^4,       xy^3z,      xy^3,       xy^2z^2,
  716.    0,          0,          0,          0,
  717. // xy^2z,      xy^2,       xyz^3,      xyz^2,
  718.    0,          0,          0,          0,
  719. // xyz,        xy,         xz^4,       xz^3,
  720.    0,          0,          0,          0,
  721. // xz^2,       xz,         x,          y^5,
  722.    0,          0,          0,          0,
  723. // y^4z,       y^4,        y^3z^2,     y^3z,
  724.    0,          0,          0,          0,
  725. // y^3,        y^2z^3,     y^2z^2,     y^2z,
  726.    0,          0,          0,          0,
  727. // y^2,        yz^4,       yz^3,       yz^2,
  728.    0,          0,          0,          0,
  729. // yz,         y,          z^5,        z^4,
  730.    0,          0,          0,          0,
  731. // z^3,        z^2,        z,          C           
  732.    0,          0,          0,          0
  733.   >
  734.   sturm // optional, slower but reduces speckles
  735. }
  736. @com.------------------------------
  737. @mt2.prism
  738. // extrude a closed 2-D shape along an axis
  739. prism {
  740.   linear_sweep // or conic_sweep for tapering to a point
  741.   cubic_spline // linear_spline | quadratic_spline | cubic_spline
  742.   -0.5,        // height 1
  743.    0.5,        // height 2
  744.   10,          // number of points
  745.   // the <u,v> points
  746.   < 0.2, -1.0>, < 0.2,  0.2>, < 1.0, -0.2>, < 1.0,  0.2>, < 0.2,  1.0>, 
  747.   <-0.2,  1.0>, <-1.0,  0.2>, <-1.0, -0.2>, <-0.2,  0.2>, <-0.2, -1.0>
  748.   // [open]
  749.   // [sturm]
  750. }
  751. @com.------------------------------
  752. @mt2.quadric
  753. // create a quadratic (2nd order) infinite polynomial surface
  754. quadric
  755. {
  756.   <0, 1, 1> //  A x^2  + B y^2  + C z^2  +
  757.   <1, 0, 0> //  D xy   + E xz   + F yz   +
  758.   <0, 3, 0> //  G x    + H y    + I z    +
  759.   2         //  J
  760.   sturm // optional, slower but reduces speckles
  761. }
  762. @com.------------------------------
  763. @mt2.quartic
  764. // create a 4th order infinite polynomial surface
  765. quartic
  766.  {
  767. <
  768. // x^4,        x^3y,       x^3z,       x^3,        x^2y^2,
  769.    0,          0,          0,          0,          0,
  770. // x^2yz,      x^2y,       x^2z^2,     x^2z,       x^2,
  771.    0,          0,          0,          0,          0,
  772. // xy^3,       xy^2z,      xy^2,       xyz^2,      xyz,
  773.    0,          0,          0,          0,          0,
  774. // xy,         xz^3,       xz^2,       xz,         x,
  775.    0,          0,          0,          0,          0,
  776. // y^4,        y^3z,       y^3,        y^2z^2,     y^2z,
  777.    0,          0,          0,          0,          0,
  778. // y^2,        yz^3,       yz^2,       yz,         y,
  779.    0,          0,          0,          0,          0,
  780. // z^4,        z^3,        z^2,        z,          C           
  781.    0,          0,          0,          0,          0
  782. >
  783.   sturm // optional, slower but reduces speckles
  784. }
  785. @com.------------------------------
  786. @mt2.smooth_triangle
  787. // rounded-surface FINITE (no CSG) triangle shape
  788. smooth_triangle
  789. {
  790.   <  0,  30, 0> <0,  0.7071, -0.7071>  // <Vertex1>  <SurfaceNormal1>
  791.   < 40, -20, 0> <0, -0.8664, -0.5>     // <Vertex2>  <SurfaceNormal2>
  792.   <  0,   0, 0> <0, -0.5,    -0.8664>  // <Vertex3>  <SurfaceNormal3>
  793. }
  794. @com.------------------------------
  795. @mt2.sphere
  796. // create a sphere shape
  797. sphere
  798. {
  799.   <0, 1, 0> // center of sphere <X Y Z>
  800.   0.5       // radius of sphere
  801.   // scale <1,2,1> // <= Note: Spheres can become ellipses by uneven scaling
  802. }
  803. @com.------------------------------
  804. @mt2.superellispoid
  805. // create a superquadric ellipsoid shape
  806. // As the exponents approach 1.0, the edges get rounder
  807. superellipsoid
  808. {
  809.   0.5,  // east-west exponent (0.0 ... 1.0)
  810.   1.0,  // north-south exponent (0.0 ... 1.0)
  811. }
  812. @com.------------------------------
  813. @mt2.Surface of Revolution
  814. // create a Surface of Revolution shape (like lathe, but faster)
  815. surface_of_revolution
  816. {
  817.     7, // # of points
  818.     <0.000000, 0.000000> // list of <u,v> points
  819.     <0.118143, 0.000000>
  820.     <0.620253, 0.540084>
  821.     <0.210970, 0.827004>
  822.     <0.194093, 0.962025>
  823.     <0.286920, 1.000000>
  824.     <0.468354, 1.033755>
  825.     // [open]
  826. }
  827. @com.------------------------------
  828. @mt2.text
  829. // create a TrueType text shape
  830. text
  831. {
  832.   ttf             // font type (only TrueType format for now)
  833.   "crystal.ttf",  // Microsoft Windows-format TrueType font file name
  834.   "POV-Ray",      // the string to create
  835.   2,              // the extrusion depth
  836.   0               // inter-character spacing
  837. }
  838. @com.------------------------------
  839. @mt2.torus
  840. // torus {MAJOR, MINOR} // (in the X-Z plane)
  841. // MAJOR = float value giving the major radius
  842. // MINOR = float specifying the minor radius
  843. // The major radius extends from the center of the hole
  844. // to the mid-line of the rim while the minor radius
  845. // is the radius of the cross-section of the rim.
  846. torus
  847. {
  848.   0.8,
  849.   0.2
  850. }
  851. @com.------------------------------
  852. @mt2.triangle
  853. // triangular FINITE (no CSG) shape (vertices are endpoints)
  854. triangle
  855. {
  856.   <-1,  0, -1>  // <Vertex1>
  857.   < 1,  0, -1>  // <Vertex2>
  858.   < 0,  0,  1>  // <Vertex3>
  859. }
  860. @com.
  861. @com.============================================================
  862. @mt1.Shape modifiers
  863. @com.============================================================
  864. @com.
  865. @com.------------------------------
  866. @mt2.bounded_by
  867. // set an outer proposed boundary for parent object(s)
  868. // allows the ray-tracer to do a quick check on the Bounding Shape,
  869. // and if outside, it skips checking this object, which can speed
  870. // up overall rendering of complex shapes.  Note that this
  871. // is not a 100% guaranteed clipping shape... use the
  872. // clipped_by statement for that.
  873. bounded_by { box { -(x+y+z) +(x+y+z) }
  874. @com.------------------------------
  875. @mt2.clipped_by
  876. // set clipping shape for parent object.
  877. // (parent shape will not extend beyond ClipShape bounds)
  878. clipped_by { sphere { 0*x, 1.0 } }
  879. @com.------------------------------
  880. @mt2.hollow
  881. // allow atmosphere inside shape
  882.   hollow
  883. @com.------------------------------
  884. @mt2.no_shadow
  885. // give object no shadow
  886.   no_shadow
  887. @com.------------------------------
  888. @mt2.open
  889. // some objects (cylinder, cone, prism, etc.) can have their ends open
  890.   open
  891. @com.
  892. @com.============================================================
  893. @mt1.CSG operations
  894. @com.============================================================
  895. @com.
  896. @com.------------------------------
  897. @mt2.difference
  898. // CSG difference, subtract intersections of shapes 2...N from Shape1
  899. difference
  900. {
  901.   Shape1 {...} // Start with this shape
  902.   Shape2 {...} // This will be "cut out" of Shape1
  903.   ShapeN {...} // This will be "cut out" of Shape1
  904. }
  905. @com.------------------------------
  906. @mt2.intersection
  907. // CSG intersection, the common space where all the shapes meet
  908. intersection
  909. {
  910.   Shape1 {...}
  911.   Shape2 {...}
  912.   ShapeN {...}
  913. }
  914. @com.------------------------------
  915. @mt2.inverse
  916. // flip an object's inside and outside for intersect/difference
  917. intersection
  918. {
  919.   Shape1 {...}
  920.   Shape2 {... inverse }
  921. }
  922. @com.------------------------------
  923. @mt2.merge
  924. // CSG merge, merge all of shapes 1...N
  925. // like “union”, but melted together so no overlap seam lines inside
  926. merge
  927. {
  928.   Shape1 {...}
  929.   Shape2 {...}
  930.   ShapeN {...}
  931. }
  932. @com.------------------------------
  933. @mt2.union
  934. // CSG union, add all of shapes 1...N
  935. union
  936. {
  937.   Shape1 {...}
  938.   Shape2 {...}
  939.   ShapeN {...}
  940. }
  941. @com.
  942. @com.============================================================
  943. @mt1.Transformations
  944. @com.============================================================
  945. @com.
  946. @mt2.matrix
  947. // Matrix is an object transformation that does rotation about the Y axis,
  948. // shear along the Y axis, and translation along the Y axis
  949. matrix
  950. <
  951.   0.886, 0.5, 0.5,
  952.   0,     1,   0,
  953.   0.5,   0,  -0.886,
  954.   0,     1.5, 0
  955. >
  956. @com.------------------------------
  957. @mt2.rotate
  958. // rotate shape or texture around <0 0 0>, relative to current orientation
  959. // example: rotate 30*x
  960. rotate <45, 45, 0> // <dX  dY  dZ> (in degrees)
  961. @com.------------------------------
  962. @mt2.scale
  963. // "resize" an object or texture relative to its current size
  964. // example: scale 2.0
  965. scale <1.0,  2.0,  1.0> // <dX dY dZ>
  966. @com.------------------------------
  967. @mt2.translate
  968. // Move object or texture relative to current position
  969. // example: translate -5.0*z
  970. translate <2.0, 4.0, -1.0>  // <dX dY dZ>
  971. @com.------------------------------
  972. @mt2.Transform
  973. // object/texture transformation
  974. // do a predeclared translate/rotate/scale combo
  975. // e.g.:
  976. #declare Leaf_Orientation = transform { scale 4.0 rotate 30*z translate 2*y }
  977. transform Leaf_Orientation // transform an object
  978. @com.
  979. @com.============================================================
  980. @mt1.Textures A-M
  981. @com.============================================================
  982. @com.
  983. @com.------------------------------
  984. @mt2.Texture Definition
  985. /*
  986. texture
  987. {
  988.   TEXTURE_IDENTIFIER
  989.   pigment {
  990.     PIGMENT_IDENTIFIER
  991.     PATTERN_TYPE
  992.     PIGMENT_MODIFIERS
  993.     TRANSFORMATIONS...
  994.   }
  995.   normal {
  996.     NORMAL_IDENTIFIER
  997.     NORMAL_PATTERN_TYPE
  998.     NORMAL_MODIFIERS
  999.     TRANSFORMATIONS...
  1000.   }
  1001.   finish {
  1002.     FINISH_IDENTIFIER
  1003.     [ ambient AMBIENT | <AMBIENT> ]
  1004.     [ diffuse DIFFUSE ]
  1005.     [ brilliance BRILLIANCE ]
  1006.     [ phong PHONG ]
  1007.     [ phong_size PHONG_SIZE ]
  1008.     [ specular SPECULAR ]
  1009.     [ roughness ROUGHNESS ]
  1010.     [ metallic [ METALLIC ] ]
  1011.     [ reflection REFLECTION | <REFLECTION> ]
  1012.     [ refraction REFRACTION ]
  1013.     [ ior IOR ]
  1014.     [ caustics CAUSTICS ]
  1015.     [ fade_distance FADE_DISTANCE ]
  1016.     [ fade_power FADE_POWER ]
  1017.     [ irid { thickness THICKNESS turbulence TURBULENCE } ]
  1018.     [ crand CRAND ]
  1019.   }
  1020.   halo {
  1021.     attenuating | emitting | glowing | dust
  1022.     [ constant | linear | cubic | poly ]
  1023.     [ planar_mapping | spherical_mapping | cylindrical_mapping | box_mapping 
  1024.     [ dust_type DUST_TYPE ]
  1025.     [ eccentricity ECCENTRICITY ]
  1026.     [ max_value MAX_VALUE ]
  1027.     [ exponent EXPONENT ]
  1028.     [ samples SAMPLES ]
  1029.     [ aa_level AA_LEVEL ]
  1030.     [ aa_threshold AA_THRESHOLD ]
  1031.     [ jitter JITTER ]
  1032.     [ turbulence <TURBULENCE> ]
  1033.     [ octaves OCTAVES ]
  1034.     [ omega OMEGA ]
  1035.     [ lambda LAMBDA ]
  1036.     [ colour_map COLOUR_MAP ]
  1037.     [ frequency FREQUENCY ]
  1038.     [ phase PHASE ]
  1039.     [ scale <VECTOR> ]
  1040.     [ rotate <VECTOR> ]
  1041.     [ translate <VECTOR> ]
  1042.   }
  1043.   TRANSFORMATIONS
  1044. }
  1045. */
  1046. @com.------------------------------
  1047. @mt2.texture example
  1048. texture
  1049. {
  1050.   pigment
  1051.   {
  1052.     marble // some pattern
  1053.     color_map {[0.1 color red 1] [0.5 color rgb 1]}
  1054.     turbulence 0.5
  1055.     scale <1,3,1>// transformations
  1056.   }
  1057.   // same pattern for normal and pigment adds weathered bumps
  1058.   normal
  1059.   {
  1060.     marble // some pattern
  1061.     turbulence 0.5
  1062.     scale <1,3,1>// transformations
  1063.   }
  1064.   finish
  1065.   {
  1066.     ambient 0.2
  1067.     specular 0.6 // shiny
  1068.   }
  1069. }
  1070. @com.------------------------------
  1071. @mt2.agate pattern
  1072. // texture pigment/normal pattern
  1073.   agate // use an agate-like texture
  1074.   agate_turb 0.3 // can alter turbulence [1.0]
  1075.   // color_map {...} // optional color map
  1076. @com.------------------------------
  1077. @mt2.ambient finish
  1078. // texture finish attribute
  1079. ambient 0.2 // set ambient surface reflection (0...1) [0.1]
  1080. @com.------------------------------
  1081. @mt2.attenuation finish
  1082. // texture finish attribute
  1083.    fade_distance 50
  1084.    fade_power 1 // 1 or 2
  1085. @com.------------------------------
  1086. @mt2.bozo pattern
  1087. // texture pigment/normal pattern
  1088. bozo // use color map to swirl colors
  1089. // turbulence 0.3
  1090. // color_map...
  1091. @com.------------------------------
  1092. @mt2.brick pattern
  1093. // texture pigment/normal pattern
  1094.   pigment
  1095.   {
  1096.     brick color Red, color Gray
  1097.     <2,1,1>   // size of brick
  1098.     0.2       // width of mortar
  1099.   }
  1100. @com.------------------------------
  1101. @mt2.brilliance finish
  1102. // texture finish attribute
  1103.   brilliance 0.5 // tightness of diffuse illumination
  1104. @com.------------------------------
  1105. @mt2.bumps pattern
  1106. // texture pigment/normal pattern
  1107.   bumps 0.3 // bumpy surface (0...1)
  1108. @com.------------------------------
  1109. @mt2.caustics finish
  1110. // texture finish attribute
  1111.    caustics 1 // (0...1)
  1112. @com.------------------------------
  1113. @mt2.checker
  1114. // texture pigment/normal pattern
  1115. // cube checker pattern, alternates color1 and color2
  1116.   checker
  1117.     color red 1 green 1 blue 1
  1118.     color red 0 green 1 blue 0
  1119. @com.------------------------------
  1120. @mt2.color
  1121. // texture pigment attribute
  1122. // RGB values can range from 0.0 (dark) to 1.0 (saturated)
  1123.   color red 0.5 green 0.5 blue 0.5 // filter 0.8
  1124. @com.------------------------------
  1125. @mt2.color_map
  1126. // texture pigment {} attribute
  1127. // create a smooth color gradation map
  1128. color_map
  1129. {
  1130.   //  [ END_VAL color red R green G blue B filter F transmit T]
  1131.   [  0.1  color red 0.0 green 0.0 blue 0.0]
  1132.   [  0.3  color red 0.8 green 0.4 blue 0.2]
  1133.   [  0.5  color red 0.0 green 0.0 blue 0.0]
  1134.   [  0.7  color red 0.0 green 0.0 blue 0.8 filter 0.5]
  1135.   [  1.0  color red 0.8 green 0.8 blue 0.8 filter 1.0]
  1136. } // color_map
  1137. @com.------------------------------
  1138. @mt2.crackle pattern
  1139. // texture pigment/normal pattern
  1140.    crackle 0.5 turbulence 0.5
  1141. @com.------------------------------
  1142. @mt2.crand finish
  1143. // texture finish attribute
  1144. // randomly speckle the surface
  1145.  // Note, this is truly random, and looks BAD in animations
  1146. crand 0.2
  1147. @com.------------------------------
  1148. @mt2.dents pattern
  1149. // texture pigment/normal pattern
  1150. dents 0.6 // dented surface (0...1) [0.0]
  1151. @com.------------------------------
  1152. @mt2.diffuse finish
  1153. // texture finish attribute
  1154. diffuse 0.6 // amount of diffuse lighting (0...1) [0.6]
  1155. @com.------------------------------
  1156. @mt2.finish component
  1157. // texture statement
  1158. finish { ambient 0.2 specular 0.5 reflection 0.2 }
  1159. @com.------------------------------
  1160. @mt2.frequency attribute
  1161. // texture pigment/normal attribute
  1162. frequency 2.0 // oscillation freq. of radial, ripples, waves, etc
  1163. @com.------------------------------
  1164. @mt2.gradient pattern
  1165. // texture pigment/normal pattern
  1166. gradient x+y // specify color_map direction(s)
  1167. // color_map {...} // requires a color map
  1168. @com.------------------------------
  1169. @mt2.granite pattern
  1170. // texture pigment/normal pattern
  1171. granite // create a granite-like texture
  1172. // color_map {...} // optional color map
  1173. @com.------------------------------
  1174. @mt2.halo component
  1175. // texture component
  1176. halo
  1177. {
  1178.   dust
  1179.   dust_type 2
  1180.   constant
  1181.   spherical_mapping
  1182.   max_value 1.0
  1183.   colour_map
  1184.   {
  1185.     [ 0 color rgbf <1, 1, 1, 0.0> ]
  1186.     [ 1 color rgbf <1, 1, 1, 0.1> ]
  1187.   } 
  1188.   samples 100
  1189.   aa_level 5
  1190.   aa_threshold 0.1
  1191.   jitter 0.8
  1192. }  
  1193. @com.------------------------------
  1194. @mt2.hexagon pattern
  1195. // texture pigment/normal pattern
  1196. // create a hexagonal pattern texture with 3 colors
  1197. // hexagons are in the X-Z plane, extending infinitely in Y plane
  1198. hexagon
  1199.   color blue 1
  1200.   color red 1
  1201.   color green 1
  1202. @com.------------------------------
  1203. @mt2.irid finish
  1204. // texture finish attribute
  1205.   irid
  1206.   {
  1207.     0.4            // amount of iridescence saturation (0...1) [0]
  1208.     thickness 0.2
  1209.     turbulence 0.7
  1210.   }
  1211. @com.------------------------------
  1212. @mt2.ior finish
  1213. // texture finish attribute
  1214. // 1.0=air, 1.33=water, 1.5=glass, 2.4=diamond (see also IOR.INC)
  1215. ior 1.3 // index of refraction
  1216. @com.------------------------------
  1217. @mt2.lambda attribute
  1218. // texture pigment/normal attribute
  1219. // change surface perturbation property
  1220. // makes turbulence more "swirly"
  1221. lambda 1.2 // (1.0...5.0) [2.0]
  1222. @com.------------------------------
  1223. @mt2.leopard pattern
  1224. // texture pigment/normal pattern
  1225. leopard // create a leopard spotted texture
  1226. // color_map {...} // optional color map
  1227. @com.------------------------------
  1228. @mt2.mandel pattern
  1229. // texture pigment/normal pattern
  1230. // create a mandelbrot fractal surface in the X-Y plane
  1231. mandel 50 // (2...1000) [256]
  1232. // scale <...> translate <...> // zoom and move
  1233. // color_map {...} // requires a color map
  1234. @com.------------------------------
  1235. @mt2.marble pattern
  1236. // texture pigment/normal pattern
  1237. marble // create a marble-like texture
  1238. // turbulence 1.0 // should have some!
  1239. // color_map {...} // uses a color map
  1240. @com.------------------------------
  1241. @mt2.metallic finish
  1242. // texture finish attribute
  1243. // use surface color, not light source color for phong hilights
  1244. metallic on // on/off
  1245. @com.
  1246. @com.============================================================
  1247. @mt1.Textures N-Z
  1248. @com.============================================================
  1249. @com.
  1250. @com.------------------------------
  1251. @mt2.normal component
  1252. // texture component
  1253.   normal { wrinkles 0.5 scale 0.5 }
  1254. @com.------------------------------
  1255. @mt2.octaves attribute
  1256. // texture pigment/normal attribute
  1257. // increases the "folds" in turbulence changes
  1258. octaves 3 // (1...10) [6]
  1259. @com.------------------------------
  1260. @mt2.omega attribute
  1261. // texture pigment/normal attribute
  1262. // change surface perturbation property
  1263. // makes turbulence more "krinkly"
  1264. omega 1.2 // (0.0...2.0) [0.5]
  1265. @com.------------------------------
  1266. @mt2.onion pattern
  1267. // texture pigment/normal pattern
  1268. onion // create an onion-like concentric circle texture
  1269. // color_map {...} // requires a color map
  1270. @com.------------------------------
  1271. @mt2.phase attribute
  1272. // texture pigment/normal attribute
  1273. // change the phase of ripples, etc.
  1274. // Animation note:  As phase DECREASES, ripples move OUTWARD.
  1275. phase 0.5
  1276. @com.------------------------------
  1277. @mt2.phong finish
  1278. // texture finish attribute
  1279. // add phong hilighting to surface (0...1)
  1280.  phong 0.8
  1281. @com.------------------------------
  1282. @mt2.phong_size finish
  1283. // texture finish attribute
  1284. // set the size of the phong spot (1...250) [40]
  1285. // 20=dull rubber, 40=plastic, 200=shiny glass
  1286. phong_size 80
  1287. @com.------------------------------
  1288. @mt2.quick_color attribute
  1289. // texture pigment attribute
  1290. quick_color green 1 // low-quality quick-render color
  1291. @com.------------------------------
  1292. @mt2.quilted pattern
  1293. // texture pigment/normal pattern
  1294. // creates a pattern like a quilt
  1295. quilted 0.4 // amount
  1296. control0 -1 // lower curvature (-1...1)
  1297. control1 1 // upper curvature (-1...1)
  1298. @com.------------------------------
  1299. @mt2.radial pattern
  1300. // texture pigment/normal pattern
  1301. // radially projected color_map in X-Z
  1302. radial
  1303. // frequency 4.0 // increases # of color "spokes"
  1304. // color_map ...
  1305. @com.------------------------------
  1306. @mt2.reflection finish
  1307. // texture finish attribute
  1308. reflection 0.3 // amount of surface reflection (0...1) [0]
  1309. @com.------------------------------
  1310. @mt2.refraction finish
  1311. // texture finish attribute
  1312. // turn this on (1) if using "filter" in pigment colors
  1313. refraction 1 // amount of pass-through light (0 or 1) [0]
  1314. @com.------------------------------
  1315. @mt2.ripples pattern
  1316. // texture pigment/normal pattern
  1317. ripples 0.5 // make surface ripply (0...1)
  1318. @com.------------------------------
  1319. @mt2.roughness finish
  1320. // texture finish attribute
  1321. // alters specular hilighting
  1322. roughness 0.01 // 1.0=rough, 0.001=smooth [0.05]
  1323. @com.------------------------------
  1324. @mt2.specular finish
  1325. // texture finish attribute
  1326. // Note: size of hilight depends on roughness attribute
  1327. specular 0.7 // use specular hilighting on surface (0...1) [0]
  1328. @com.------------------------------
  1329. @mt2.spiral1 pattern
  1330. // texture pigment/normal pattern
  1331.   spiral1 5
  1332. @com.------------------------------
  1333. @mt2.spiral2 pattern
  1334. // texture pigment/normal pattern
  1335.   spiral2 5, 0.6
  1336. @com.------------------------------
  1337. @mt2.spotted pattern
  1338. // texture pigment/normal pattern
  1339.   spotted // create a spotted texture, turbulence has no effect
  1340. // color_map {...} // requires a color map
  1341. @com.------------------------------
  1342. @mt2.turbulence attribute
  1343. // texture pigment/normal attribute
  1344. // Takes a float or vector, see also octaves, omega, lambda, frequency
  1345. turbulence <0, 1, 0.5> // how much to “stir up” the texture (0...1 or more)
  1346. @com.------------------------------
  1347. @mt2.warp attribute
  1348. // texture pigment modifier
  1349. warp { turbulence 0.4*x octaves 2 repeat x*2  flip y  offset z*0.25 }
  1350. @com.------------------------------
  1351. @mt2.waves pattern
  1352. // texture pigment/normal pattern
  1353. // create a wavy surface (also use phase)
  1354. waves 0.5
  1355. @com.------------------------------
  1356. @mt2.wood pattern
  1357. // texture pigment/normal pattern
  1358. // create a concentric cylindrical wood-like texture,
  1359. // grain along Z axis
  1360. wood
  1361. // turbulence 0.1 // should have some!
  1362. // color_map {...} // optional color map
  1363. @com.------------------------------
  1364. @mt2.wrinkles pattern
  1365. // texture pigment/normal pattern
  1366. // create a wrinkly surface (0...1 or more)
  1367. wrinkles 0.5
  1368. @com.------------------------------
  1369. @com.
  1370. @com.============================================================
  1371. @mt1.Texture Colors
  1372. @com.============================================================
  1373. @com.
  1374. @com.------------------------------
  1375. @mt2.blue
  1376. color blue 1
  1377. @com.------------------------------
  1378. @mt2.filter
  1379. color red 1 filter 1
  1380. @com.------------------------------
  1381. @mt2.green
  1382. color green 1
  1383. @com.------------------------------
  1384. @mt2.red
  1385. color red 1
  1386. @com.------------------------------
  1387. @mt2.transmit
  1388. color green 1 transmit 1
  1389. @com.------------------------------
  1390. @mt2.rgb
  1391. // rgb - Red Green Blue color shortcut
  1392. color rgb <0.2, 0.3, 0.4>
  1393. @com.------------------------------
  1394. @mt2.rgbf
  1395. // rgbf - Red Green Blue Filter color shortcut
  1396. color rgbf <0.2, 0.3, 0.4, 0.9>
  1397. @com.------------------------------
  1398. @mt2.rgbft
  1399. // rgbft - Red Green Blue Filter Transmit color shortcut
  1400. // NOTE: filter + transmit should always equal 1.0
  1401. color rgbft <0.5, 0.5, 0.5, 0.4, 0.6>
  1402. @com.------------------------------
  1403. @mt2.rgbt
  1404. // rgbt - Red Green Blue Transmit color shortcut
  1405. color rgbt <0.2, 0.3, 0.4, 0.9>
  1406. @com.------------------------------
  1407. @mt2.color components
  1408. // extract each component of a color:
  1409. // #if (MyColor.red < 0.5) ...
  1410. // #if (MyColor.green < 0.5) ...
  1411. // #if (MyColor.blue < 0.5) ...
  1412. // #if (MyColor.filter < 0.5) ...
  1413. // #if (MyColor.transmit < 0.5) ...
  1414. @com.
  1415. @com.============================================================
  1416. @mt1.Texture Maps
  1417. @com.============================================================
  1418. @com.
  1419. @com.------------------------------
  1420. @mt2.bump_map normal
  1421. // texture normal {} attribute
  1422. // create a texture that has a bumpiness corresponding to color index
  1423. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1424. bump_map
  1425. { // uses image color or index as bumpiness
  1426.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1427.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1428.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1429.   // [use_color | use_index]
  1430.   // [once]
  1431.   bump_size 0.5 // 0...3
  1432. } // bump_map
  1433. @com.------------------------------
  1434. @mt2.image_map pigment
  1435. // texture pigment {} attribute
  1436. // create a texture that lays an image's colors onto a surface
  1437. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1438. image_map
  1439. {
  1440.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1441.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1442.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1443.   // [filter N V] // N=all or color index # (0...N), V= value (0.0...1.0)
  1444.   // [transmit N V] // N=all or color index # (0...N), V= value (0.0...1.0)
  1445.   // [use_color | use_index]
  1446.   // [once]
  1447. } // image_map
  1448. @com.------------------------------
  1449. @mt2.material_map texture
  1450. // texture attribute
  1451. // create a texture that maps different textures onto different color indexes
  1452. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1453. material_map
  1454. {
  1455.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1456.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1457.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1458.   // [once]
  1459.   texture { pigment {wood} }  // texture for color index # 0
  1460.   texture { pigment {granite} }  // texture for color index # 1
  1461.   texture { pigment {agate} }  // texture for color index # 2
  1462.   // etc...
  1463. } // material_map
  1464. @com.------------------------------
  1465. @mt2.tiles texture
  1466. // texture component
  1467. // create a tiled texture, alternates between 2 full textures
  1468. tiles
  1469. {
  1470.   texture    // full texture of tile #1
  1471.   {
  1472.     pigment { agate scale 0.3 }
  1473.     finish { ambient 0.2 }
  1474.   }
  1475.   tile2
  1476.   texture    // full texture of tile #2
  1477.   {
  1478.     pigment { granite }
  1479.     finish { specular 0.3 reflection 0.2 }
  1480.   }
  1481. }
  1482. @com.
  1483. @com.============================================================
  1484. @mt1.Std colors
  1485. @com.============================================================
  1486. @com.
  1487. @mt2."Colors.inc"
  1488. // Standard pre-defined colors
  1489. #include "colors.inc"
  1490. @com.
  1491. @com.============================================================
  1492. @mt1.Ready-Made Scenes
  1493. @com.============================================================
  1494. @com.
  1495. @com.------------------------------
  1496. @mt2.Basic scene
  1497. // Persistence of Vision Ray Tracer Scene Description File
  1498. // File: ?.pov
  1499. // Vers: 3
  1500. // Desc: Basic Scene Example
  1501. // Date: mm/dd/yy
  1502. // Auth: ?[esp]
  1503. //
  1504.  
  1505. #version 3
  1506.  
  1507. #include "colors.inc"
  1508.  
  1509. global_settings
  1510. {
  1511.   assumed_gamma 1.0
  1512. }
  1513.  
  1514. // ----------------------------------------
  1515. camera
  1516. {
  1517.   location  <0.0, 0.5, -4.0>
  1518.   direction 1.5*z
  1519.   right     4/3*x
  1520.   look_at   <0.0, 0.0,  0.0>
  1521. }
  1522.  
  1523. sky_sphere
  1524. {
  1525.   pigment
  1526.   {
  1527.     gradient y
  1528.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1529.   }
  1530. }
  1531.  
  1532. light_source
  1533. {
  1534.   0*x // light's position (translated below)
  1535.   color red 1.0  green 1.0  blue 1.0  // light's color
  1536.   translate <-30, 30, -30>
  1537. }
  1538.  
  1539. // ----------------------------------------
  1540. plane { y, -1 pigment {color rgb <0.7,0.5,0.3>}}
  1541.  
  1542. sphere { 0.0, 1 texture {pigment {radial frequency 8} finish{specular 1}} }
  1543.  
  1544. @com.------------------------------
  1545. @mt2.Checkered floor
  1546. // Persistence of Vision Ray Tracer Scene Description File
  1547. // File: ?.pov
  1548. // Vers: 3
  1549. // Desc: Checkered Floor Example
  1550. // Date: mm/dd/yy
  1551. // Auth: ?
  1552. //
  1553.  
  1554. #version 3
  1555.  
  1556. #include "colors.inc"
  1557.  
  1558. global_settings
  1559. {
  1560.   assumed_gamma 1.0
  1561. }
  1562.  
  1563. // ----------------------------------------
  1564. camera
  1565. {
  1566.   location  <0.0, 0.5, -4.0>
  1567.   direction 1.5*z
  1568.   right     4/3*x
  1569.   look_at   <0.0, 0.0,  0.0>
  1570. }
  1571.  
  1572. sky_sphere
  1573. {
  1574.   pigment
  1575.   {
  1576.     gradient y
  1577.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1578.   }
  1579. }
  1580.  
  1581. light_source
  1582. {
  1583.   0*x // light's position (translated below)
  1584.   color red 1.0  green 1.0  blue 1.0  // light's color
  1585.   translate <-30, 30, -30>
  1586. }
  1587.  
  1588. // ----------------------------------------
  1589. plane
  1590. {
  1591.   y, -1
  1592.   texture
  1593.   {
  1594.     pigment {checker color rgb 1 color blue 1 scale 0.5}
  1595.     finish {reflection 0.2}
  1596.   }
  1597. }
  1598.  
  1599. sphere { 0.0, 1 texture {pigment {radial frequency 8} finish{specular 1}} }
  1600.  
  1601. @com.------------------------------
  1602. @mt2.Text Fonts
  1603. // Persistence of Vision Ray Tracer Scene Description File
  1604. // File: ?.pov
  1605. // Vers: 3
  1606. // Desc: Basic TTF font Example
  1607. // Date: mm/dd/yy
  1608. // Auth: ?
  1609. //
  1610.  
  1611. #version 3
  1612.  
  1613. global_settings
  1614. {
  1615.   assumed_gamma 1.0
  1616. }
  1617.  
  1618. // ----------------------------------------
  1619. camera
  1620. {
  1621.   location  <0.0, 2.0, -6.0>
  1622.   direction 1.5*z
  1623.   right     4/3*x
  1624.   look_at   <0.0, 0.0,  0.0>
  1625. }
  1626.  
  1627. sky_sphere
  1628. {
  1629.   pigment
  1630.   {
  1631.     gradient y
  1632.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1633.   }
  1634. }
  1635.  
  1636. light_source
  1637. {
  1638.   0*x // light's position (translated below)
  1639.   color red 1.0  green 1.0  blue 1.0  // light's color
  1640.   translate <-20, 10, -30>
  1641. }
  1642.  
  1643. // ----------------------------------------
  1644.  
  1645. #declare Text_Tex = texture
  1646. {
  1647.   pigment { granite scale 0.5 }
  1648.   finish { specular 0.7 }
  1649. }
  1650.  
  1651. text
  1652. {
  1653.   ttf "crystal.ttf", "Hello",
  1654.   2, // depth
  1655.   0  // spacing
  1656.   texture {Text_Tex}
  1657.   rotate <0, -20, 0>
  1658.   translate <-1, 0, -3>
  1659. }
  1660.  
  1661. text
  1662. {
  1663.   ttf "crystal.ttf", "Virtual World!",
  1664.   1, // depth
  1665.   0  // spacing
  1666.   scale <1, 2, 1> // stretch it taller
  1667.   texture {Text_Tex}
  1668.   rotate <0, -30, 0>
  1669.   translate <-3, 0, 3>
  1670. }
  1671.  
  1672.  
  1673. plane { y, 0 pigment {color rgb <0.7,0.5,0.3>} }
  1674.  
  1675. @com.------------------------------
  1676. @mt2.Image Map
  1677. // Persistence of Vision Ray Tracer Scene Description File
  1678. // File: ?.pov
  1679. // Vers: 3
  1680. // Desc: Image Map Example
  1681. // Date: mm/dd/yy
  1682. // Auth: ?
  1683. //
  1684.  
  1685. #version 3
  1686.  
  1687. #include "colors.inc"
  1688.  
  1689. global_settings
  1690. {
  1691.   assumed_gamma 1.0
  1692. }
  1693.  
  1694. // ----------------------------------------
  1695. camera
  1696. {
  1697.   location  <0.0, 0.0, -4.0>
  1698.   direction 2*z
  1699.   right     4/3*x
  1700.   look_at   <0.0, 0.0,  0.0>
  1701. }
  1702.  
  1703. sky_sphere
  1704. {
  1705.   pigment
  1706.   {
  1707.     gradient y
  1708.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1709.   }
  1710. }
  1711.  
  1712. light_source
  1713. {
  1714.   0*x // light's position (translated below)
  1715.   color red 1.0  green 1.0  blue 1.0  // light's color
  1716.   translate <-30, 30, -30>
  1717. }
  1718.  
  1719. // ----------------------------------------
  1720. plane
  1721. {
  1722.   y, -1
  1723.   texture
  1724.   {
  1725.     pigment {checker color rgb 1 color blue 1 scale 0.5}
  1726.     finish {reflection 0.2}
  1727.   }
  1728. }
  1729.  
  1730. plane
  1731. {
  1732.   z, -1
  1733.   texture
  1734.   {
  1735.     pigment
  1736.     {
  1737.       image_map
  1738.       {
  1739.         gif "test.gif"
  1740.         interpolate 2 // smooth it
  1741.         once   // don't tile image, just one copy
  1742.         filter 0 0.8  // make 1st color mostly transparent
  1743.         filter 1 0.8  // make 2nd color mostly transparent
  1744.       }
  1745.       // transform it to unit-size (-1 to +1)
  1746.       translate -0.5*(x+y) // center on the origin
  1747.       scale 2              // make it unit-sized
  1748.     }
  1749.     finish {ambient 0.3}
  1750.   }
  1751. }
  1752. @com.============================================================
  1753. @com.end of file is next
  1754. @@@@
  1755.