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

  1. // Persistence of Vision Raytracer
  2. // Image by Dan Farmer
  3. // Demonstrates glass textures, CGS with box primitives, one of Mike Miller's
  4. // fabulous marble textures, modified with an "octaves" change, and doesn't
  5. // make a half-bad image, either.  Interesting lighting effect, too.
  6.  
  7. #include "colors.inc"           // Standard colors library
  8. #include "shapes.inc"           // Commonly used object shapes
  9. #include "textures.inc"         // LOTS of neat textures.  Lots of NEW textures.
  10. #include "stones.inc"           // SPECIAL!  Mike Miller's stone library.
  11.  
  12. camera {
  13.    location <+0.75  3.5  -3.5>
  14.    direction <0.0 0.0  0.5>       //  "wide-angle" view
  15.    up  <0.0  1.0  0.0>
  16.    right <1.33333 0.0 0.0>
  17.    look_at <0 0 -1>
  18. }
  19.  
  20. // Light sources, two to the front, right, on from the left, rear.
  21. object { light_source { <-30 11 +20>  color White  } }
  22. object { light_source { <31 12 -20>  color White  } }
  23. object { light_source { <32 11 -20>  color LightGray  } }
  24.  
  25. composite {
  26.  
  27.    // A green glass ball inside of a box-shaped frame
  28.    object {  sphere {< 0 0 0> 1.75 }
  29.       texture {
  30.          Glass                          // use the predefined "glass"
  31.          color green 0.90 alpha 0.85    // transmit most of it's light
  32.          phong 1 phong_size 300         // Very tight highlights
  33.          reflection 0.15                // Needs a little reflection added
  34.       }
  35.    }
  36.  
  37.  
  38.    // A box-shaped frame surrounding a green glass ball
  39.    object {
  40.       intersection {
  41.          box {UnitBox scale <1.5 1.5 1.5> }    // The outside dimensions
  42.  
  43.          // And some square "holes" in all sides.  I think I could use
  44.          // difference (no inverse in the union) instead, but I must've
  45.          // lost my head for a moment.  Note that each of these boxes
  46.          // that are going to be subtracted has one vector scaled just
  47.          // slightly larger than the outside box.  The other two vectors
  48.          // determine the size of the hole.
  49.          union {   // Clip some sqr holes in the box to make a 3D box frame
  50.             box {UnitBox scale <1.51 1.25 1.25> }   // "clip" x
  51.             box {UnitBox scale <1.25 1.51 1.25> }   // "clip" y
  52.             box {UnitBox scale <1.25 1.25 1.51> }   // "clip" z
  53.             inverse
  54.          }
  55.       }
  56.       texture {   // Totally un-spectacular.  _You_ can do better than this!
  57.          ambient 0.2
  58.          diffuse 0.7
  59.          reflection 0.15
  60.          brilliance 8.0
  61.          specular 1
  62.          roughness 0.01
  63.          color red 0.75 green 0.75 blue 0.85
  64.       }
  65.    }
  66.  
  67.    bounded_by {     // Same as radius of glass sphere, not the box!
  68.       box {UnitBox scale <1.75 1.75 1.75> }
  69.    }
  70.    rotate <0 45 0>
  71. }
  72.  
  73. object {  plane {< 0 1 0> -1.5 }
  74.    texture {
  75.       Stone1
  76.       octaves 3
  77.       rotate <0 0 90>
  78.       reflection 0.15
  79.    }
  80. }
  81. // end of file
  82.