home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / varia / povray3 / povray3_040 / pov3demo / anim / atmo / atmo.pov < prev   
Text File  |  1997-12-12  |  5KB  |  209 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. #include "colors.inc"
  9. #include "textures.inc"
  10.  
  11. camera {
  12.   location <5, 6, -18>
  13.   right 4/3*x
  14.   up y
  15.   direction z
  16.   angle 80
  17.   look_at <0, 4, 0>
  18. }
  19.  
  20. //
  21. // Declare the various atmospheres. 
  22. //
  23. // Note the different reflectivities due to the different scattering models.
  24. //
  25.  
  26. //
  27. // Atmosphere with isotropic scattering (independent of incident light). 
  28. //
  29.  
  30. #declare Atmosphere1 = atmosphere {
  31.   type 1
  32.   samples 50        // Number of samples in first distance interval
  33.   distance 30       // Atmosphere density, similar to fog
  34.   scattering 0.2    // Reflectivity of atmosphere, determines brightness
  35.   aa_level 8        // Level of binary subdivision in case of aa
  36.   aa_threshold 0.1  // Threshold for aa to push in
  37.   jitter 0.25       // Amount of sample jittering
  38. }
  39.  
  40. //
  41. // Atmosphere with Mie cattering, hazy atmosphere (dependent of incident light). 
  42. //
  43.  
  44. #declare Atmosphere2 = atmosphere {
  45.   type 2
  46.   samples 50        // Number of samples in first distance interval
  47.   distance 30       // Atmosphere density, similar to fog
  48.   scattering 1.2    // Reflectivity of atmosphere, determines brightness
  49.   aa_level 8        // Level of binary subdivision in case of aa
  50.   aa_threshold 0.1  // Threshold for aa to push in
  51.   jitter 0.25       // Amount of sample jittering
  52. }
  53.  
  54. //
  55. // Atmosphere with Mie scattering, murky atmosphere (dependent of incident light).
  56. //
  57.  
  58. #declare Atmosphere3 = atmosphere {
  59.   type 3
  60.   samples 50        // Number of samples in first distance interval
  61.   distance 30       // Atmosphere density, similar to fog
  62.   scattering 1.5    // Reflectivity of atmosphere, determines brightness
  63.   aa_level 8        // Level of binary subdivision in case of aa
  64.   aa_threshold 0.1  // Threshold for aa to push in
  65.   jitter 0.25       // Amount of sample jittering
  66. }
  67.  
  68. //
  69. // Atmosphere with Rayleigh scattering (dependent of incident light). 
  70. //
  71.  
  72. #declare Atmosphere4 = atmosphere {
  73.   type 4
  74.   samples 50        // Number of samples in first distance interval
  75.   distance 30       // Atmosphere density, similar to fog
  76.   scattering 0.2    // Reflectivity of atmosphere, determines brightness
  77.   aa_level 8        // Level of binary subdivision in case of aa
  78.   aa_threshold 0.1  // Threshold for aa to push in
  79.   jitter 0.25       // Amount of sample jittering
  80. }
  81.  
  82. //
  83. // Use atmosphere. 
  84. //
  85.  
  86. atmosphere { Atmosphere1 }
  87.  
  88. //
  89. // Light sources not interacting with the atmosphere.
  90. //
  91.  
  92. light_source { <0, 15, 0> color Gray20 atmosphere off }
  93.  
  94. //
  95. // Spotlights pointing at shaft.
  96. //
  97.  
  98. light_source {
  99.   <0, 0, 0> color White
  100.   spotlight
  101.   point_at <0, 100, 0>
  102.   radius 25
  103.   falloff 45
  104.   tightness 2
  105.   atmospheric_attenuation on
  106.   rotate z*60 + (30*clock)
  107.   translate y*6
  108.   rotate y*(360*clock)
  109. }
  110.  
  111. light_source {
  112.   <0, 0, 0> color White
  113.   spotlight
  114.   point_at <0, 100, 0>
  115.   radius 25
  116.   falloff 60
  117.   tightness 2
  118.   atmospheric_attenuation on
  119.   rotate -z*80 + (10*clock)
  120.   translate y*6
  121.   rotate y*(360*clock)
  122. }
  123.  
  124. //
  125. // Declare steps. 
  126. //
  127.  
  128. #declare Step = prism
  129. {
  130.   linear_spline
  131.   linear_sweep
  132.   0, 1, 9
  133.   <cos(radians(0*45)), sin(radians(0*45))>, 
  134.   <cos(radians(1*45)), sin(radians(1*45))>, 
  135.   <cos(radians(2*45)), sin(radians(2*45))>,
  136.   <cos(radians(3*45)), sin(radians(3*45))>, 
  137.   <cos(radians(4*45)), sin(radians(4*45))>, 
  138.   <cos(radians(5*45)), sin(radians(5*45))>,
  139.   <cos(radians(6*45)), sin(radians(6*45))>, 
  140.   <cos(radians(7*45)), sin(radians(7*45))>,
  141.   <cos(radians(0*45)), sin(radians(0*45))> 
  142.   rotate 22.5*y
  143. }
  144.  
  145. #declare Stair = union {
  146.   object { 
  147.     Step
  148.     scale <10, 0.5, 10>
  149.     translate <0, 0, 0>
  150.   }
  151.   object { 
  152.     Step
  153.     scale <8, 0.5, 8>
  154.     translate <0, 0.5, 0>
  155.   }
  156.   object { 
  157.     Step
  158.     scale <6, 0.5, 6>
  159.     translate <0, 1, 0>
  160.   }
  161. }
  162.  
  163. //
  164. // Declare shaft. 
  165. //
  166.  
  167. #declare Shaft = cylinder {
  168.   <0, 0, 0>, <0, 1, 0>, 1
  169. }
  170.  
  171. //
  172. // Declare object.
  173. //
  174.  
  175. #declare Thing = difference {
  176.   box { <-1, -1, -1> <1, 1, 1> }
  177.   box { <-0.7, -0.7, -1.1>, <0.7, 0.7, 1.1> }
  178.   box { <-0.7, -0.7, -1.1>, <0.7, 0.7, 1.1> rotate 90*x }
  179.   box { <-0.7, -0.7, -1.1>, <0.7, 0.7, 1.1> rotate 90*y }
  180. }
  181.  
  182. //
  183. // Position objects.
  184. //
  185.  
  186. object {
  187.   Stair
  188.   pigment { color rgb<1.0, 0.3, 0.3> }
  189.   finish { ambient 0.2 diffuse 0.5 }
  190. }
  191.  
  192. object {
  193.   Thing
  194.   scale <3, 3, 3>
  195.   translate <0, 1.5+3, 0>
  196.   texture { Copper_Metal }
  197. }
  198.  
  199. //
  200. // Room.
  201. //
  202.  
  203. box { <-25, 0, -25>, <25, 25, 25>
  204.   pigment { color White }
  205.   finish { ambient 0.2 diffuse 0.5 }
  206.   hollow
  207. }
  208.  
  209.