home *** CD-ROM | disk | FTP | other *** search
/ ANews 3 / AnewsCD3.iso / atari / GRAPHX / POV / 68030.060 / POV31G30 / POVRAY_3.1G / SCENES / INTERIOR / MAGGLASS.POV < prev    next >
Text File  |  1999-10-30  |  2KB  |  99 lines

  1. // Persistence Of Vision raytracer version 3.1 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.  
  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.      hollow on
  35.      finish { crand 0.015 }
  36.      pigment {
  37.         gradient y
  38.         color_map {
  39.             [0.0 1.0 color Gray80 color Gray30]
  40.         }
  41.         scale 10000
  42.     }
  43. }
  44.  
  45. // A lens.  This uses the Ellipsoid quadric to make it independantly
  46. // scalable, but it would be faster to use spheres.
  47. // It is designed "sideways" so you can see the thickness.
  48. // It is then rotated 90o on Y so the viewer is looking through the lens.
  49. #declare Lens_Thickness = 0.35;
  50. #declare Lens_Diameter = 1.5;
  51.  
  52. #declare Lens =
  53. intersection {
  54.    sphere { <0, 0, 0>, 1.5 translate <0.75, 0, 0> }
  55.    sphere { <0, 0, 0>, 1.5 translate <-0.75, 0, 0> }
  56.  
  57.    interior{ior Flint_Glass_Ior}
  58.    texture {
  59.        T_Glass3
  60.        finish {
  61.           reflection 0                  // Over-ride reflection
  62.        }
  63.    }
  64.  
  65.    scale <Lens_Thickness, Lens_Diameter, Lens_Diameter>
  66. }
  67.  
  68.  
  69. plane { y, -4
  70.     pigment {
  71.        checker color HuntersGreen color SummerSky
  72.        scale <3, 1, 3>
  73.     }
  74.     finish {
  75.        ambient 0.2
  76.        diffuse 0.6
  77.     }
  78. }
  79.  
  80. object { Lens rotate 80*y }
  81.  
  82. // A sphere in the distance
  83. sphere { <3, 1, 30>, 2 finish {Phong_Shiny} pigment {Orange} }
  84.  
  85. object { Cylinder_X
  86.    finish {
  87.       Phong_Shiny
  88.       ambient 0.25
  89.       diffuse 0.6
  90.    }
  91.    pigment {
  92.       granite
  93.       scale 2
  94.    }
  95.  
  96.     rotate -75*y
  97.     translate <0 ,-3, 25>
  98. }
  99.