home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / varia / povray3 / povray3_fpu / pov3demo / surfaces / slopemap.pov < prev    next >
Text File  |  1997-12-12  |  4KB  |  139 lines

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // Slope_map example
  3.  
  4. #version 3.0
  5. global_settings { assumed_gamma 2.2 }
  6.  
  7. #include "colors.inc"
  8.  
  9. camera {
  10.      location <0,0,-20>
  11.      direction 3*z
  12.  }
  13.  
  14. #declare Amt=<0,0,0>
  15.  
  16.  light_source { <200, 200, -500> color White}
  17.  
  18.  #default {
  19.      pigment { White }
  20.      normal{
  21.          onion .5
  22.          scale .4
  23.      }
  24.      finish { phong 0.8 phong_size 200 }
  25.  }
  26.  
  27.  #declare Thing =
  28.  box{ <-1,-1,0>,<1,1,1> scale .85 }
  29.  
  30.  // top row, left to right
  31.  object { Thing
  32.      normal{
  33.      }
  34.      rotate Amt translate <-3,2,0>
  35.  }
  36.  object { Thing
  37.      normal{
  38.        slope_map {     // triangle_wave the hard way
  39.          [0   <0, 1>]   // start at bottom and slope up
  40.          [0.5 <1, 1>]   // halfway through reach top still climbing
  41.          [0.5 <1,-1>]   // abruptly slope down
  42.          [1   <0,-1>]   // finish on down slope at bottom
  43.        }
  44.      }
  45.      rotate Amt translate <0,2,0>
  46.  }
  47.  object { Thing
  48.      normal{
  49.        slope_map {         // sine_wave the hard way
  50.          [0    <0.5, 1>]   // start in middle and slope up
  51.          [0.25 <1.0, 0>]   // flat slope at top of wave
  52.          [0.5  <0.5,-1>]   // slope down at mid point
  53.          [0.75 <0.0, 0>]   // flat slope at bottom
  54.          [1    <0.5, 1>]   // finish in middle and slope up
  55.        }
  56.      }
  57.      rotate Amt translate <3,2,0>
  58.  }
  59.  
  60.  // middle row, left to right
  61.  object { Thing
  62.      normal{
  63.        slope_map {      // reverse ramp wave
  64.          [0   <1,-1>]   // start at top and slope down
  65.          [1   <0,-1>]   // finish on down slope at bottom
  66.        }
  67.      }
  68.      rotate Amt translate <-3,0,0>
  69.  }
  70.  object { Thing
  71.      normal{
  72.        slope_map {      // scallop_wave the hard way
  73.          [0   <0, 1>]   // start at bottom and slope up
  74.          [0.5 <1, 0>]   // halfway through reach top flat
  75.          [1   <0,-1>]   // finish on down slope at bottom
  76.        }
  77.      }
  78.      rotate Amt translate <0,0,0>
  79.  }
  80.  
  81.  object { Thing
  82.      normal{
  83.        slope_map {      // scallop_wave with steep slopes
  84.          [0   <0, 3>]   // 3.0 is suggested max
  85.          [0.5 <1, 0>]   // halfway through reach top flat
  86.          [1   <0,-3>]   // what goes up...
  87.        }
  88.      }
  89.      rotate Amt translate <3,0,0>
  90.  }
  91.  
  92.  // bottom row, left to right
  93.  object { Thing
  94.      normal{
  95.        slope_map {      // Now let's get fancy
  96.          [0.0  <0, 1>]   // Do tiny tringle here
  97.          [0.2  <1, 1>]   //  down
  98.          [0.2  <1,-1>]   //     to
  99.          [0.4  <0,-1>]   //       here.
  100.          [0.4  <0, 0>]   // Flat area
  101.          [0.5  <0, 0>]   //   through here.
  102.          [0.5  <1, 0>]   // Square wave leading edge
  103.          [0.6  <1, 0>]   //   trailing edge
  104.          [0.6  <0, 0>]   // Flat again
  105.          [0.7  <0, 0>]   //   through here.
  106.          [0.7  <0, 3>]   // Start scallop
  107.          [0.8  <1, 0>]   //   flat on top
  108.          [0.9  <0,-3>]   //     finish here.
  109.          [0.9  <0, 0>]   // Flat remaining through 1.0
  110.        }
  111.        scale 2  // so you can see details
  112.      }
  113.      rotate Amt translate <-3,-2,0>
  114.  }
  115.  
  116.  object { Thing
  117.      normal{
  118.        slope_map {      // Surf's up dude!
  119.          [0   <0,  0.0>]   // start at bottom flat
  120.          [0.7 <1,  0.0>]   // S-curv to flat top 
  121.          [0.7 <0,  0.0>]   // drop to bottom
  122.          [1.0 <0,  0.0>]   //  flat
  123.        }
  124.      }
  125.      rotate Amt translate <0,-2,0>
  126.  }
  127.  object { Thing
  128.      normal{
  129.        slope_map {      // inverse scallop_wave 
  130.          [0   <0, 0>]   // start at bottom flat
  131.          [0.5 <1, 3>]   // halfway through reach bottom peak
  132.          [0.5 <1,-3>]   // star down again
  133.          [1   <0, 0>]   // finish on flat bottom
  134.        }
  135.      }
  136.      rotate Amt translate <3,-2,0>
  137.  }
  138.  
  139.