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

  1. // Persistence Of Vision raytracer version 3.1 sample file.
  2. // File by Dan Farmer
  3. // Wine glass and chessboard
  4. // Updated October, 1996
  5. // Updated January, 1998  DCB
  6.  
  7. global_settings { assumed_gamma 1.0 number_of_waves 3 }
  8.  
  9. #include "colors.inc"
  10. #include "shapes.inc"
  11. #include "textures.inc"
  12. //#include "glass.inc"
  13. #include "metals.inc"
  14.  
  15. camera {
  16.    location <50.0, 55.0, -75.0>
  17.    direction z
  18.    up y
  19.    right x*4/3
  20.    look_at <-10.0, 18.0, 0.0>
  21. }
  22.  
  23. light_source { <10.0, 50.0, 35.0> colour White }
  24. light_source { <-35.0, 30.0, -150.0> colour White }
  25.  
  26.  
  27. #declare I_Glass1 =                  // Use with Liquid
  28.    interior{
  29.       ior 1.45
  30.       caustics 2
  31.       fade_distance 40                   // only for this scene
  32.       fade_power 1
  33.    }
  34.  
  35.  
  36. #declare I_Glass2 =                    //Use with Bead
  37.     interior{
  38.        fade_distance 1.5              // only for this scene
  39.        fade_power 1
  40.        ior 1.45
  41.        caustics 2
  42.     }
  43.  
  44.  
  45. #declare I_Glass3 =                  //Use with Rim
  46.    interior{
  47.       ior 1.51
  48.       caustics 2
  49.       fade_distance 0.025   
  50.       fade_power 1
  51.    }
  52.  
  53. #declare I_Glass4 =                  //Use with Top & Stem
  54.    interior{
  55.       ior 1.51
  56.       caustics 2
  57.       fade_distance 1.5   
  58.       fade_power 1
  59.    }
  60.  
  61. #declare I_Glass5 =                 // Use with Base
  62.    interior{
  63.        ior 1.51
  64.        caustics 2
  65.        fade_distance 3.25              
  66.        fade_power 1
  67.      }
  68.  
  69.  
  70. #declare T_Glass = texture {
  71.    pigment { color red 1.0 green 1.0 blue 1.0 filter 0.95 }
  72.    finish {
  73.       ambient 0.0
  74.       diffuse 0.0
  75.       reflection 0.1
  76.       phong 0.3
  77.       phong_size 90
  78.    }
  79. }
  80.  
  81. #declare Wine = color red 1.0 filter 0.85;
  82.  
  83. #declare Liquid = finish { reflection 0.05 }
  84.  
  85. #declare Bead = object {
  86.    sphere { <0, 0, 0>, 1 scale <1.65, 0.65, 1.65> }
  87.    texture { T_Glass}
  88.    interior {I_Glass2}
  89.     
  90. }
  91.  
  92. #declare Rim =
  93.    torus {0.975, 0.025
  94.    clipped_by { plane { -y, 0.0 } }
  95.    scale <15.0, 10.0, 15.0>
  96.    translate 24.0*y
  97.    texture {T_Glass}
  98.    interior{I_Glass3}
  99. }
  100.  
  101. #declare Top = intersection {
  102.    plane { y, 1.0  }
  103.    object { QCone_Y }
  104.    object { QCone_Y scale <0.97, 1.0, 0.97> inverse }
  105.  
  106.    clipped_by { plane { y, 0.0  inverse } }
  107.    scale <15.0, 10.0, 15.0>
  108.    translate 14.0*y
  109.    texture { T_Glass}
  110.    interior {I_Glass4}
  111. }
  112.  
  113. #declare Stem =
  114. cylinder { y*3.25, y*14, 1
  115.   texture { T_Glass}
  116.   interior {I_Glass4}
  117. }
  118.  
  119.  
  120. #declare Base = object {
  121.    QCone_Y
  122.    clipped_by {
  123.       plane { y, 0.0  }
  124.       plane { y, -1.0 inverse }
  125.    }
  126.    translate 1.0*y         /* This actually puts the base of the cone on y=0*/
  127.    scale <12.0, 3.25, 12.0>
  128.    texture { T_Glass}
  129.    interior { I_Glass5}
  130. }
  131.  
  132. #declare Wine2 =
  133. union {
  134.    cone { 0, 0, y, 0.95 open
  135.       texture {
  136.          finish { Liquid }
  137.          pigment { Wine }
  138.       }
  139.    }
  140.    disc { y, y, 0.95
  141.       texture {
  142.          finish { Liquid
  143.             specular 1
  144.             roughness 0.01
  145.          }
  146.          pigment { Wine }
  147.          normal { onion 0.75 frequency 3 sine_wave turbulence 0.15 }
  148.       }
  149.       interior { I_Glass1}
  150.  
  151.    }
  152.    scale <14.9, 9.5, 14.9>
  153.    translate 14.0*y
  154.    texture {
  155.       finish { Liquid }
  156.       pigment { Wine }
  157.    }
  158.    interior { I_Glass1}
  159. }
  160.  
  161.  
  162. #declare Frame =
  163. union {
  164.    // corners
  165.    sphere { <-120, 0, -120>, 4.65 }
  166.    sphere { < 120, 0, -120>, 4.65 }
  167.    sphere { <-120, 0,  120>, 4.65 }
  168.    sphere { < 120, 0,  120>, 4.65 }
  169.  
  170.    object {
  171.       Disk_X    /* Front rounded edge */
  172.       scale <120, 4.65, 4.65>
  173.       translate -z*120
  174.    }
  175.    object {
  176.       Disk_Z    /* Left rounded edge */
  177.       scale <4.65, 4.65, 120>
  178.       translate -x*120
  179.    }
  180.    object {
  181.       Disk_X    /* Rear rounded edge */
  182.       scale <120, 4.65, 4.65>
  183.       translate  z*120
  184.    }
  185.    object {
  186.       Disk_Z    /* Right rounded edge */
  187.       scale <4.65, 4.65, 120>
  188.       translate x*120
  189.    }
  190.    texture { Silver_Texture }
  191. }
  192.  
  193. #declare ChessBoard = object {
  194.    Cube
  195.    scale <120.0, 4.0, 120.0>
  196.  
  197.    texture {
  198.       tiles {
  199.          texture {
  200.            pigment {
  201.                marble
  202.                turbulence 1
  203.                lambda 2.1
  204.                omega 0.707
  205.                scale <2, 1, 2>
  206.                color_map {
  207.                    [0.00 rgb 0.975 ]
  208.                    [0.55 rgb <0.2, 0.25, 0.3>]
  209.                    [0.75 rgb 0.2 ]
  210.                    [0.85 rgb 0.5 ]
  211.                    [1.00 rgb 0.975 ]
  212.               }
  213.            }
  214.            finish { diffuse 1 }
  215.          }
  216.       tile2
  217.          texture {
  218.             pigment { Gray10 }
  219.             finish { diffuse 1 specular 0.5 roughness 0.025}
  220.          }
  221.       }
  222.    scale <30.0, 4.001, 30.0>
  223.    }
  224. }
  225.  
  226.  
  227. #declare WineGlass_Without_Wine = merge {
  228.    object { Rim   }
  229.    object { Top   }
  230.    object { Bead  translate 14.5*y }
  231.    object { Bead  translate 10.0*y }
  232.    object { Bead  translate  7.0*y }
  233.    object { Bead  translate  3.0*y }
  234.    object { Stem  }
  235.    object { Base  }
  236.    scale <1.0, 1.50, 1.0>
  237. }
  238. #declare WineGlass_With_Wine = union {
  239.    object { WineGlass_Without_Wine }
  240.    object { Wine2
  241.       scale <1.0, 1.50, 1.0>
  242.    }
  243. }
  244.  
  245.  
  246. fog { distance 200 color Black }
  247.  
  248. /* Ground plane */
  249. plane {
  250.    y, 0.0
  251.    texture {
  252.       pigment { RichBlue }
  253.       normal {
  254.          quilted 0.45
  255.          control0 1 control1 1
  256.          scale <0.45, 1, 0.45>
  257.       }
  258.    }
  259. }
  260.  
  261. union {
  262.     object { Frame }
  263.     object { ChessBoard }
  264.     translate <0.0, 4.0, 145.0>
  265. }
  266.  
  267. // How did I figure out those wierd transformations below?
  268. // Well, they'd be less obscure had I created the wine glass properly,
  269. // but since I didn't, I simply put the camera a tiny bit above the
  270. // floorplane and tried various values until it "fit".
  271.  
  272. object { WineGlass_Without_Wine translate -x*12.15 rotate -z*86.5 }
  273.  
  274. object { WineGlass_With_Wine translate <0, 0, -20>}
  275.  
  276.