home *** CD-ROM | disk | FTP | other *** search
/ Ray Tracing Box / RAY_CD.mdf / raytrace / _pov_dat / morein / magglass.inc < prev    next >
Text File  |  1993-02-01  |  2KB  |  114 lines

  1. /*This is the data file for a magnifying glass with a shiny metal frame and a black handle*/
  2.  
  3. #include "colors.inc"
  4. #include "shapes.inc"
  5. #include "textures.inc"
  6.  
  7.  
  8. /*camera { //un-comment the camera and light source to make adjustments
  9.   location <0 1 -5>
  10.   direction <0 2 0>
  11.   up        <0 1 0>
  12.   right     <1.33 0 0>
  13.   look_at   <0 0 2>
  14. }*/
  15.  
  16. /*object {
  17.   light_source {<4 3 -4> color White}
  18. }*/
  19.  
  20. /*object { //this is an image_map background to give the glass something to magnify-substitute your own
  21.   sphere {<0 0 0> 100}
  22.     texture {//color Green
  23.       image_map {gif "weave.gif" map_type 1 interpolate 4}
  24.       scale <100 100 100>
  25.     }
  26. }*/
  27.  
  28. #declare Glass=   // This is the lens
  29.   intersection {
  30.     sphere {<0 .938 0> 1}
  31.     sphere {<0 -.938 0> 1}
  32.   }
  33.  
  34.  
  35. #declare Hollow_Cylinder=  //This is needed to make the frame
  36.   difference {
  37.    quadric {
  38.      Cylinder_Y
  39.    }
  40.    quadric {
  41.      Cylinder_Y
  42.      scale <.925 1 .925>
  43.    }
  44.   }
  45.   
  46.  
  47. #declare Frame =  //This is the frame for the lens
  48.   intersection {
  49.     Hollow_Cylinder
  50.     plane {<0 1 0> -1 translate <0 2 0>}
  51.     plane {<0 1 0> -1 inverse translate <0 1.7 0>}
  52.   }
  53.   //texture {color Red}
  54.   //rotate <-15 0 0>
  55.   //translate <0 -.75 0>
  56.  
  57. #declare Mag_Glass= //This is the complete form of the Magnifying glass
  58.   composite {   
  59.    object {
  60.     intersection {
  61.       Glass 
  62.       translate <0 .275 0>
  63.       rotate <-90 0 0>
  64.       scale <2 2 2>
  65.     }
  66.     texture {color red 1.0  blue 1.0  green 1.0  alpha 1.0
  67.     reflection .1
  68.     refraction 1.0
  69.     specular 1.0
  70.     roughness .001
  71.     ior 1.5
  72.     phong 1 phong_size 200
  73.     }
  74.    }
  75.    object {
  76.     intersection {
  77.       Frame
  78.     }
  79.     scale <.75 .75 .75>
  80.     rotate <-90 0 0>
  81.     translate <0 0 .15>
  82.     texture {
  83.       color LightGray
  84.       metallic
  85.       ambient 0.2
  86.       diffuse 0.7
  87.       brilliance 6.0
  88.       reflection 0.25
  89.       phong 0.8 phong_size 80
  90.     }
  91.    //rotate <90 0 0>
  92.    }
  93.    object {
  94.     intersection {
  95.       quadric {
  96.         Cylinder_Y
  97.         scale <.1 1 .1>
  98.       }
  99.       plane {<0 1 0> -1 translate <0 2 0>}
  100.       plane {<0 1 0> -1 inverse translate <0 .65 0>}
  101.     }
  102.     rotate <0 0 -90>
  103.     translate <1.05 -.07 -.5>
  104.     texture {
  105.       color Black
  106.       specular 1.0
  107.       reflection .04
  108.       phong 1 phong_size 60
  109.     }
  110.    }
  111.   rotate <90 0 0>
  112.   rotate <0 0 0>
  113.   //translate <-.5 .3 1>
  114.   }