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

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // File by Dieter Bayer
  3. // Atmospheric environment with spotlights.
  4.  
  5. #version 3.0
  6. global_settings { assumed_gamma 2.2 }
  7.  
  8. camera {
  9.   location <5, 6, -18>
  10.   right 4/3*x
  11.   up y
  12.   direction z
  13.   angle 80
  14.   look_at <0, 4, 0>
  15. }
  16.  
  17. //
  18. // Declare the various atmospheres. 
  19. //
  20. // Note the different reflectivities due to the different scattering models.
  21. //
  22.  
  23. //
  24. // Atmosphere with isotropic scattering (independent of incident light). 
  25. //
  26.  
  27. #declare Atmosphere1 = atmosphere {
  28.   type 1
  29.   samples 10        // Number of samples in first distance interval
  30.   distance 40       // Atmosphere density, similar to fog
  31.   scattering 0.3    // Reflectivity of atmosphere, determines brightness
  32.   aa_level 4        // Level of binary subdivision in case of aa
  33.   aa_threshold 0.1  // Threshold for aa to push in
  34.   jitter 0.4        // Amount of sample jittering
  35. }
  36.  
  37. //
  38. // Atmosphere with Mie cattering, hazy atmosphere (dependent of incident light). 
  39. //
  40.  
  41. #declare Atmosphere2 = atmosphere {
  42.   type 2
  43.   samples 10        // Number of samples in first distance interval
  44.   distance 40       // Atmosphere density, similar to fog
  45.   scattering 0.5    // Reflectivity of atmosphere, determines brightness
  46.   aa_level 4        // Level of binary subdivision in case of aa
  47.   aa_threshold 0.1  // Threshold for aa to push in
  48.   jitter 0.25       // Amount of sample jittering
  49. }
  50.  
  51. //
  52. // Atmosphere with Mie scattering, murky atmosphere (dependent of incident light). 
  53. //
  54.  
  55. #declare Atmosphere3 = atmosphere {
  56.   type 3
  57.   samples 10        // Number of samples in first distance interval
  58.   distance 40       // Atmosphere density, similar to fog
  59.   scattering 0.5    // Reflectivity of atmosphere, determines brightness
  60.   aa_level 4        // Level of binary subdivision in case of aa
  61.   aa_threshold 0.1  // Threshold for aa to push in
  62.   jitter 0.25       // Amount of sample jittering
  63. }
  64.  
  65. //
  66. // Atmosphere with Rayleigh scattering (dependent of incident light). 
  67. //
  68.  
  69. #declare Atmosphere4 = atmosphere {
  70.   type 4
  71.   samples 10        // Number of samples in first distance interval
  72.   distance 40       // Atmosphere density, similar to fog
  73.   scattering 0.5    // Reflectivity of atmosphere, determines brightness
  74.   aa_level 4        // Level of binary subdivision in case of aa
  75.   aa_threshold 0.1  // Threshold for aa to push in
  76.   jitter 0.25       // Amount of sample jittering
  77. }
  78.  
  79. //
  80. // Use atmosphere. 
  81. //
  82.  
  83. atmosphere { Atmosphere1 }
  84.  
  85. //
  86. // Light source not interacting with the atmosphere. 
  87. //
  88.  
  89. light_source { <0, 15, 0> color red .3 green .3 blue .3 atmosphere off }
  90.  
  91. //
  92. // Spotlights pointing at shaft. 
  93. //
  94.  
  95. #declare Spot = light_source { 
  96.   <0, 0, 0> color red 1 green 1 blue 1
  97.   spotlight
  98.   point_at <0, -1, 0>
  99.   radius 2
  100.   falloff 3
  101.   atmospheric_attenuation on
  102. }
  103.  
  104. #declare Spots = union {
  105.   object { Spot rotate <0, 0,  15> rotate <0,   0, 0> }
  106.   object { Spot rotate <0, 0,  15> rotate <0,  30, 0> }
  107.   object { Spot rotate <0, 0,  15> rotate <0,  60, 0> }
  108.   object { Spot rotate <0, 0,  15> rotate <0,  90, 0> }
  109.   object { Spot rotate <0, 0,  15> rotate <0, 120, 0> }
  110.   object { Spot rotate <0, 0,  15> rotate <0, 150, 0> }
  111.   object { Spot rotate <0, 0,  15> rotate <0, 180, 0> }
  112.   object { Spot rotate <0, 0,  15> rotate <0, 210, 0> }
  113.   object { Spot rotate <0, 0,  15> rotate <0, 240, 0> }
  114.   object { Spot rotate <0, 0,  15> rotate <0, 270, 0> }
  115.   object { Spot rotate <0, 0,  15> rotate <0, 300, 0> }
  116.   object { Spot rotate <0, 0,  15> rotate <0, 330, 0> }
  117.   object { Spot rotate <0, 0,  30> rotate <0,  10, 0> }
  118.   object { Spot rotate <0, 0,  30> rotate <0,  40, 0> }
  119.   object { Spot rotate <0, 0,  30> rotate <0,  70, 0> }
  120.   object { Spot rotate <0, 0,  30> rotate <0, 100, 0> }
  121.   object { Spot rotate <0, 0,  30> rotate <0, 130, 0> }
  122.   object { Spot rotate <0, 0,  30> rotate <0, 160, 0> }
  123.   object { Spot rotate <0, 0,  30> rotate <0, 190, 0> }
  124.   object { Spot rotate <0, 0,  30> rotate <0, 220, 0> }
  125.   object { Spot rotate <0, 0,  30> rotate <0, 250, 0> }
  126.   object { Spot rotate <0, 0,  30> rotate <0, 280, 0> }
  127.   object { Spot rotate <0, 0,  30> rotate <0, 310, 0> }
  128.   object { Spot rotate <0, 0,  30> rotate <0, 340, 0> }
  129.   object { Spot rotate <0, 0,  45> rotate <0,  20, 0> }
  130.   object { Spot rotate <0, 0,  45> rotate <0,  50, 0> }
  131.   object { Spot rotate <0, 0,  45> rotate <0,  80, 0> }
  132.   object { Spot rotate <0, 0,  45> rotate <0, 110, 0> }
  133.   object { Spot rotate <0, 0,  45> rotate <0, 140, 0> }
  134.   object { Spot rotate <0, 0,  45> rotate <0, 170, 0> }
  135.   object { Spot rotate <0, 0,  45> rotate <0, 200, 0> }
  136.   object { Spot rotate <0, 0,  45> rotate <0, 230, 0> }
  137.   object { Spot rotate <0, 0,  45> rotate <0, 260, 0> }
  138.   object { Spot rotate <0, 0,  45> rotate <0, 290, 0> }
  139.   object { Spot rotate <0, 0,  45> rotate <0, 320, 0> }
  140.   object { Spot rotate <0, 0,  45> rotate <0, 350, 0> }
  141. }
  142.  
  143. //
  144. // Declare steps. 
  145. //
  146.  
  147. #declare Step = prism
  148. {
  149.   linear_spline
  150.   linear_sweep
  151.   0, 1, 9
  152.   <cos(radians(0*45)), sin(radians(0*45))>, 
  153.   <cos(radians(1*45)), sin(radians(1*45))>, 
  154.   <cos(radians(2*45)), sin(radians(2*45))>, 
  155.   <cos(radians(3*45)), sin(radians(3*45))>, 
  156.   <cos(radians(4*45)), sin(radians(4*45))>, 
  157.   <cos(radians(5*45)), sin(radians(5*45))>, 
  158.   <cos(radians(6*45)), sin(radians(6*45))>, 
  159.   <cos(radians(7*45)), sin(radians(7*45))>,
  160.   <cos(radians(0*45)), sin(radians(0*45))>
  161.   rotate 22.5*y
  162. }
  163.  
  164. #declare Stair = union {
  165.   object { 
  166.     Step
  167.     scale <10, 0.5, 10>
  168.     translate <0, 0, 0>
  169.   }
  170.   object { 
  171.     Step
  172.     scale <8, 0.5, 8>
  173.     translate <0, 0.5, 0>
  174.   }
  175.   object { 
  176.     Step
  177.     scale <6, 0.5, 6>
  178.     translate <0, 1, 0>
  179.   }
  180. }
  181.  
  182. //
  183. // Declare shaft. 
  184. //
  185.  
  186. declare Shaft1 = union {
  187.   cylinder { <0, 0.0, 0>, <0, 4.0, 0>, 0.6 }
  188.   cylinder { <0, 4.0, 0>, <0, 5.0, 0>, 0.8 }
  189.   cylinder { <0, 5.0, 0>, <0, 6.0, 0>, 0.4 }
  190.   cylinder { <0, 6.0, 0>, <0, 7.0, 0>, 0.2 }
  191. }
  192.  
  193. //
  194. // Position objects.
  195. //
  196.  
  197. object {
  198.   Spots
  199.   translate <0, 20, 0>
  200. }
  201.  
  202. object {
  203.   Stair 
  204.   pigment { color red 1 green 0.3 blue 0.3 }
  205.   finish { ambient 0.2 diffuse 0.5 }
  206. }
  207.  
  208. object { 
  209.   Shaft1
  210.   translate <0, 1.5, 0>
  211.   pigment { color red 0.3 green 1 blue 0.3 }
  212.   finish { ambient 0.2 diffuse 0.5 phong 1 phong_size 20 }
  213. }
  214.  
  215. //
  216. // Room. 
  217. //
  218.  
  219. box { <-25, 0, -25>, <25, 25, 25>
  220.   pigment { color red 1 green 1 blue 1 }
  221.   finish { ambient 0.2 diffuse 0.5 }
  222.   hollow
  223. }
  224.  
  225.