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

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // Distance based attenuation in translucent objects example
  3.  
  4. #version 3.0
  5. global_settings { assumed_gamma 2.2 }
  6.  
  7. #include "colors.inc"
  8.  
  9. #declare IOR = 1.5
  10. #declare Distance = 5
  11.  
  12. #declare Col1 = -15
  13. #declare Col2 =  35
  14. #declare Row1 =  30
  15. #declare Row2 = -10
  16.  
  17. camera {
  18.   orthographic
  19.   location <0, 0, -100>
  20.   right 80 * 4/3 * x
  21.   up    80 * y
  22.   look_at <0, 0, 0>
  23. }
  24.  
  25. //
  26. // Use beloved famous raytrace green/yellow checkered wall
  27. //
  28.  
  29. plane { z, 20
  30.    pigment {
  31.       checker colour Yellow colour Green
  32.       scale 4
  33.    }
  34.    finish {
  35.       ambient 0.2
  36.       diffuse 0.8
  37.    }
  38. }
  39.  
  40. //
  41. // Make a prism.
  42. //
  43.  
  44. #declare Prism = prism {
  45.   -0.5, 0.5, 3
  46.   <-1, -0.3>, <1, 0>, <-1, 0.3>
  47.   scale 12
  48. }
  49.  
  50. //
  51. // Translucent prism without attenuation
  52. //
  53.  
  54. object { Prism translate <Col1, Row1, 0>
  55.    pigment { rgbt<1, 1, 1, 0.9> }
  56.    finish {
  57.       ambient 0
  58.       diffuse 0
  59.       refraction 1
  60.       ior IOR
  61.       phong 1
  62.       phong_size 200
  63.       fade_distance Distance
  64.       fade_power 0
  65.    }
  66. }
  67.  
  68. //
  69. // Translucent prism with linear attenuation
  70. //
  71.  
  72. object { Prism translate <Col2, Row1, 0>
  73.    pigment { rgbt<1, 1, 1, 0.9> }
  74.    finish {
  75.       ambient 0
  76.       diffuse 0
  77.       refraction 1
  78.       ior IOR
  79.       phong 1
  80.       phong_size 200
  81.       fade_distance Distance
  82.       fade_power 1
  83.    }
  84. }
  85.  
  86. //
  87. // Translucent prism with quadratic attenuation
  88. //
  89.  
  90. object { Prism translate <Col1, Row2, 0>
  91.    pigment { rgbt<1, 1, 1, 0.9> }
  92.    finish {
  93.       ambient 0
  94.       diffuse 0
  95.       refraction 1
  96.       ior IOR
  97.       phong 1
  98.       phong_size 200
  99.       fade_distance Distance
  100.       fade_power 2
  101.    }
  102. }
  103.  
  104. //
  105. // Translucent prism with cubic attenuation
  106. //
  107.  
  108. object { Prism translate <Col2, Row2, 0>
  109.    pigment { rgbt<1, 1, 1, 0.9> }
  110.    finish {
  111.       ambient 0
  112.       diffuse 0
  113.       refraction 1
  114.       ior IOR
  115.       phong 1
  116.       phong_size 200
  117.       fade_distance Distance
  118.       fade_power 3
  119.    }
  120. }
  121.  
  122. //
  123. // Due to the atmospheric attenuation and the large distance to
  124. // the light source it has to be very bright.
  125. //
  126.  
  127. light_source { <10000, 10000, -10000> colour White }
  128.  
  129.