home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / varia / povray3 / povray3_fpu / povscn / level2 / magglass.pov < prev    next >
Text File  |  1997-12-12  |  2KB  |  98 lines

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // Magnifying glass created using POV-Ray's refraction.
  3. // A convex lens created with CSG
  4. // (and something to view through it)
  5. // This example doesn't work very well, but it gives a good
  6. // starting point for a better use of the magnifying glass.
  7.  
  8. #version 3.0
  9. global_settings { assumed_gamma 2.2 }
  10.  
  11. #include "colors.inc"
  12. #include "shapes.inc"
  13. #include "textures.inc"
  14. #include "glass.inc"
  15. #include "consts.inc"                  // Index of refraction constants
  16.  
  17. camera {
  18.    location <0.0, 2, -10>
  19.    direction <0.0, 0.0, 1>
  20.    angle 40
  21.    up  <0.0, 1.0, 0.0>
  22.    right <4/3, 0.0, 0.0>
  23.    look_at <0, 0, 0>
  24. }
  25.  
  26. light_source { <30, 50, -50> color White }
  27.  
  28. light_source { <-30, 10, 20> color Gray50 }
  29.  
  30. fog { color Gray50 distance 200 }  // This fog reaches max density at 200z
  31.  
  32. // Background sphere
  33. sphere { <0, 0, 0>, 1
  34.      finish { crand 0.015 }
  35.      pigment {
  36.         gradient y
  37.         color_map {
  38.             [0.0 1.0 color Gray80 color Gray30]
  39.         }
  40.         scale 10000
  41.     }
  42. }
  43.  
  44. // A lens.  This uses the Ellipsoid quadric to make it independantly
  45. // scalable, but it would be faster to use spheres.
  46. // It is designed "sideways" so you can see the thickness.
  47. // It is then rotated 90o on Y so the viewer is looking through the lens.
  48. #declare Lens_Thickness = 0.35
  49. #declare Lens_Diameter = 1.5
  50.  
  51. #declare Lens =
  52. intersection {
  53.    sphere { <0, 0, 0>, 1.5 translate <0.75, 0, 0> }
  54.    sphere { <0, 0, 0>, 1.5 translate <-0.75, 0, 0> }
  55.  
  56.    texture {
  57.        T_Glass3
  58.        finish {
  59.           ior Flint_Glass_Ior           // Over-ride the Glass IOR value
  60.           reflection 0                  // Over-ride reflection, too
  61.        }
  62.    }
  63.  
  64.    scale <Lens_Thickness, Lens_Diameter, Lens_Diameter>
  65. }
  66.  
  67.  
  68. plane { y, -4
  69.     pigment {
  70.        checker color HuntersGreen color SummerSky
  71.        scale <3, 1, 3>
  72.     }
  73.     finish {
  74.        ambient 0.2
  75.        diffuse 0.6
  76.     }
  77. }
  78.  
  79. object { Lens rotate 80*y }
  80.  
  81. // A sphere in the distance
  82. sphere { <3, 1, 30>, 2 finish {Phong_Shiny} pigment {Orange} }
  83.  
  84. object { Cylinder_X
  85.    finish {
  86.       Phong_Shiny
  87.       ambient 0.25
  88.       diffuse 0.6
  89.    }
  90.    pigment {
  91.       granite
  92.       scale 2
  93.    }
  94.  
  95.     rotate -75*y
  96.     translate <0 ,-3, 25>
  97. }
  98.