home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / varia / povray3 / povray3_060 / pov3demo / other / switch4.pov < prev    next >
Text File  |  1997-12-12  |  891b  |  36 lines

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // Demonstrates #switch and #range directives
  3. //
  4. // If +k0 through +k2 you get red pigment
  5. // If +k greater than 2 but less than or equal 3 you get green pigment.
  6. // All others are blue.
  7.  
  8. #version 3.0
  9. global_settings { assumed_gamma 2.2 }
  10.  
  11. #include "colors.inc"
  12.  
  13. camera {
  14.    location  <0, 20,-100>
  15. }
  16.  
  17. plane { y, -10
  18.    pigment {White}
  19.    finish {ambient 0.2 diffuse 0.8}
  20. }
  21.  
  22. sphere { <0, 25, 0>, 40
  23.    #switch (clock)
  24.      #range (0,2)      // Note clock=1 is red, not blue because
  25.        pigment {Red}   // once a true condition is found, all
  26.        #break          // other case or range values are ignored.
  27.      #range (1,3)      // This range is only used if all previous
  28.        pigment {Green} // ranges or cases are false.
  29.        #break
  30.      #else
  31.        pigment {Blue}
  32.    #end
  33. }
  34.  
  35. light_source {<100, 120, -200> colour White}
  36.