home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / graphics / ftpovscn / 3 / dfwood.pov < prev    next >
Text File  |  1992-07-21  |  6KB  |  177 lines

  1. // Persistence Of Vision raytracer version 1.0 sample file.
  2.  
  3. /* Persistence of Vision Raytracer
  4.    Scene file by Dan Farmer       Dec 1, 1991
  5.    Demo of POV-Ray wood texture possibilities
  6.  
  7.    Note:  This image contains very fine detail in the texture.  To truly
  8.           see the image as it's intended to look it should be rendered
  9.           at *least* 360x480, with a minimum anti-aliasing threshold of
  10.           +a0.05 (that's not 0.5).  It can look pretty good if you do,
  11.           and pretty awful if you don't.  Really.
  12.           Time to render at 640x480 +a0.025 on a 486/33: 9 hrs 30 min.
  13.           (a lot less without the anti-aliasing!)
  14. -----------------------------------------------------------------------------
  15. */
  16. #include "colors.inc"
  17. #include "shapes.inc"
  18. #include "textures.inc"
  19.  
  20. // Symmetrical Disk_Z, scales equally both directions, unit length.
  21. #declare Disk_Z = intersection {       /* Capped cylinder, Length in z axis */
  22.    quadric { Cylinder_Z }
  23.    plane { <0.0 0.0 1.0> -1.0 inverse }
  24.    plane { <0.0 0.0 1.0>  1.0 }
  25. }
  26.  
  27. #declare Tan = color red 0.86 green 0.58 blue 0.44
  28. #declare Brown = colour red 0.647059 green 0.164706 blue 0.164706
  29. #declare DarkBrown = color red 0.45 green 0.26 blue 0.24
  30.  
  31.  
  32. camera {
  33.    location <-20 15 -20>
  34.    direction <0 0 1.7>
  35.    up  <0 1 0>
  36.    right <1.33333 0 0>
  37.    look_at <-2 5 0>
  38. }
  39.  
  40.  
  41. object {   /* light */
  42.    light_source { <-15 10 -13>
  43.       colour red 0.8 green 0.8 blue 0.8
  44.    }
  45. }
  46.  
  47. object {   /* light */
  48.    light_source { <-10 30 20>
  49.       colour red 0.6 green 0.6 blue 0.6
  50.    }
  51. }
  52.  
  53. object {   /* background */
  54.    sphere { <0 0 0> 1 }
  55.    color Gray
  56.    texture {
  57.       ambient 1.0  diffuse 0
  58.       gradient <0 1 0>
  59.       color_map {
  60.          [0.0 1.01 color red 0.50 green 0.50 blue 0.50
  61.          color red 0.0 green 0.0 blue 0.0]
  62.       }
  63.       translate <0 1 0>
  64.    }
  65.    scale <255 255 255>
  66. }
  67.  
  68.  
  69. #declare WoodBlock = object {
  70.    difference {
  71.  
  72.       // a block with a beveled front edge
  73.       intersection {
  74.  
  75.          intersection { Cube scale <10 5 2> }
  76.  
  77.          // Take a 45 degree cut from left top edge
  78.          plane { <-1 0 0> 0
  79.             rotate <0 0 -45>
  80.             translate <-10 0 0>
  81.          }
  82.  
  83.       }
  84.  
  85.       // bore a hole through block
  86.       quadric { Cylinder_Z scale <4 4 1> translate <5 0 0> }
  87.  
  88.    }
  89.  
  90.    color White
  91.  
  92.    // This texture { is two layers:  the lower "base-coat" is finely
  93.    // "speckled" to simulate the fine pores in the wood.  The second,
  94.    // "top-coat" is the darker woodgrain, fading into clear to let
  95.    // the "base-coat" show through.
  96.    texture {    // Bottom, shiny layer: fine porous woodgrain
  97.       bozo
  98.       color_map {
  99.          [0.00 0.05 color Brown color Brown]
  100.          [0.05 0.25 color Brown color Tan]
  101.          [0.25 0.75 color Tan color Tan]
  102.          [0.75 0.95 color Tan color Brown]
  103.          [0.95 1.01 color Brown color Brown]
  104.       }
  105.  
  106.       // Note: i've designed this layer to be scaled in the z axis and
  107.       // then rotated 90 degrees on the y axiz to maintain consistancy with
  108.       // the way wood texture { operates.
  109.       scale <0.01 0.01 1>
  110.       rotate <0 90 0>
  111.  
  112.       ambient 0.15 diffuse 0.7
  113.       specular 1 roughness 0.005   // Make this layer shiny
  114.       phong 1 phong_size 100
  115.    }
  116.  
  117.  
  118.    // Wood texture { is mapped in concentric rings aligned on the z axis.
  119.    texture {      // Top texture {, dark grain
  120.       wood
  121.       turbulence 0.05   // Note the small amount of turbulence used.
  122.  
  123.       color_map {
  124.          [0.00 0.05 color Clear         color Clear    ]
  125.          [0.05 0.30 color Clear         color DarkBrown]
  126.          [0.30 0.70 color DarkBrown     color DarkBrown]
  127.          [0.70 0.95 color DarkBrown     color Clear    ]
  128.          [0.95 1.01 color Clear         color Clear    ]
  129.       }
  130.  
  131.       scale <0.1 0.1 1>         // Make 10 "rings" per unit
  132.       translate <0 -0.5 0>      // (This is just a cosmetic adjustment)
  133.       scale <3 3 3>             // Enlarge the whole thing.
  134.       rotate <0 90 0>           // align the "log" on the x axis, not z
  135.       rotate <0 -1 0>           // slightly askew of center
  136.       ambient 0.15 diffuse 0.7  // Notice: no shine on this layer
  137.    }
  138.  
  139.    bounded_by {
  140.       intersection { Cube scale <10.1 5.1 2.5> }
  141.    }
  142.  
  143.    translate <0 5 0>             // Put the base of the block at y=0
  144. }
  145.  
  146.  
  147. // a "POV Ray" medallion stamped into the side.  This is, of course
  148. // optional.  To create povray2.gif" i used improces, a shareware paint
  149. // and image-processing program.  Text was entered and converted to
  150. // black & white.   The text was smoothed repeatedly using a combination
  151. // of the averaging and custom filters to "spread" the text and soften
  152. // the edges so the bump_map would have a nice, smooth gradient to build
  153. // the edges with.  Simply comment out the "object Logo" line in the
  154. // composite block below if you don't want to create the .gif.  Won't
  155. // detract from the image at all.
  156. //#declare Logo = object {
  157. //   intersection { Disk_Z
  158. //       scale <1.75 1.75 1>
  159. //       translate <0 0 -1>
  160. //   }
  161. //   texture {
  162. //       Copper_Texture
  163. //       bump_map { <1 -1 0> gif "povray2.gif"  once  // 320x200 image
  164. //           bumpsize -10
  165. //           interpolate 4
  166. //       }
  167. //       translate <-0.5 -0.65 0>
  168. //       scale <1.6 1.5 1>
  169. //       scale <2 2 1>
  170. //   }
  171. //}
  172.  
  173. composite {
  174.    object { WoodBlock }
  175.    //    object { Logo translate <-7 2.5 0> }
  176. }
  177.