home *** CD-ROM | disk | FTP | other *** search
/ Chestnut's Multimedia Mania / MM_MANIA.ISO / graphics / povscn20 / desk.pov < prev    next >
Text File  |  1993-09-27  |  8KB  |  409 lines

  1. // Persistence Of Vision raytracer version 2.0 sample file.
  2.  
  3. // By  Tom Price
  4. // Requires "rough.gif" 320x200x256, but feel free to substitute any
  5. // image that you wish.  (It goes in a picture frame on the desk)
  6.  
  7. #include "shapes.inc"
  8. #include "colors.inc"
  9. #include "textures.inc"
  10.  
  11. #declare
  12. RedPencil = union {
  13.    intersection {
  14.       object { Cylinder_Y scale <0.5, 1.0, 0.5> }
  15.       plane { y, 30.0 }
  16.       plane { y, 0.0 inverse }
  17.  
  18.       finish {
  19.          crand 0.05
  20.          ambient 0.3
  21.          diffuse 0.7
  22.       }
  23.       pigment { Red }
  24.    }
  25.  
  26.    intersection {
  27.       object { Cylinder_Y scale <0.5, 1.0, 0.5> }
  28.       plane { y, 32.0 }
  29.       plane { y, 30.0 inverse }
  30.  
  31.       finish {
  32.          crand 0.05
  33.          ambient 0.3
  34.          diffuse 0.7
  35.       }
  36.       pigment { Tan }
  37.    }
  38. }
  39.  
  40. #declare
  41. GreenPencil = union {
  42.    intersection {
  43.       object { Cylinder_Y scale <0.5, 1.0, 0.5> }
  44.       plane { y, 30.0 }
  45.       plane { y, 0.0 inverse }
  46.  
  47.       finish {
  48.          crand 0.05
  49.          ambient 0.3
  50.          diffuse 0.7
  51.       }
  52.       pigment { Green }
  53.    }
  54.  
  55.    intersection {
  56.       object { Cylinder_Y scale <0.5, 1.0, 0.5> }
  57.       plane { y, 32.0 }
  58.       plane { y, 30.0 inverse }
  59.  
  60.       finish {
  61.          crand 0.05
  62.          ambient 0.3
  63.          diffuse 0.7
  64.       }
  65.       pigment { Tan }
  66.    }
  67. }
  68.  
  69. #declare
  70. BluePencil = union {
  71.    intersection {
  72.       object { Cylinder_Y scale <0.5, 1.0, 0.5> }
  73.       plane { y, 30.0 }
  74.       plane { y, 0.0 inverse }
  75.  
  76.       finish {
  77.          crand 0.05
  78.          ambient 0.3
  79.          diffuse 0.7
  80.       }
  81.       pigment { Blue }
  82.    }
  83.    intersection {
  84.       object { Cylinder_Y scale <0.5, 1.0, 0.5> }
  85.       plane { y, 32.0 }
  86.       plane { y, 30.0 inverse }
  87.  
  88.       finish {
  89.          crand 0.05
  90.          ambient 0.3
  91.          diffuse 0.7
  92.       }
  93.       pigment { Tan }
  94.    }
  95. }
  96.  
  97. camera {
  98.    location <0.0, 40.0, -150.0>
  99.    up <0.0, 1.0, 0.0>
  100.    right <4/3, 0.0, 0.0>
  101.    look_at <0.0, 0.0, 0.0>
  102. }
  103.  
  104. /*The back wall*/
  105.  
  106. plane { z, 200.0
  107.    finish {
  108.       crand 0.1
  109.       ambient 0.3
  110.       diffuse 0.7
  111.    }
  112.    pigment { LightGray }
  113. }
  114.  
  115. /*The ceiling*/
  116. plane { y,  500.0
  117.    finish {
  118.       crand 0.1
  119.       ambient 0.3
  120.       diffuse 0.7
  121.    }
  122.    pigment { White }
  123. }
  124.  
  125.  
  126. /*The desk surface*/
  127. intersection {
  128.    plane { y,    2.0 }
  129.    plane { y,   -2.0 inverse }
  130.    plane { z,  100.0 }
  131.    plane { z, -100.0 inverse }
  132.    plane { x,  125.0 }
  133.    plane { x, -125.0 inverse }
  134.  
  135.    translate -20.0*y
  136.  
  137.    finish {
  138.       crand 0.05
  139.       ambient 0.4
  140.       diffuse 0.6
  141.       reflection 0.2
  142.       brilliance 3.0
  143.    }
  144.    pigment {
  145.       Dark_Wood
  146.       scale <5.0, 1.0, 1.0>
  147.    }
  148. }
  149.  
  150. /*Paperwork*/
  151. union {
  152.    triangle {
  153.       <0.0, 0.0, 0.0>
  154.       <8.5, 0.0, 0.0>
  155.       <0.0, 0.0, -11.0>
  156.    }
  157.    triangle {
  158.       <0.0, 0.0, -11.0>
  159.       <8.5, 0.0, -11.0>
  160.       <8.5, 0.0, 0.0>
  161.    }
  162.  
  163.    scale <3.0, 1.0, 3.0>
  164.    rotate -30.0*y
  165.    translate <-20.0, -17.9, -40.0>
  166.  
  167.    finish {
  168.       crand 0.05
  169.       ambient 0.1
  170.       diffuse 0.4
  171.    }
  172.    pigment { colour red 0.5 green 0.5 blue 0.3 }
  173. }
  174.  
  175. /*a glass paperweight*/
  176. intersection {
  177.    sphere { <0.0, -5.0, 0.0>, 10.0 }
  178.    plane { y, 0.0 inverse }
  179.  
  180.    translate <0.0, -17.8, -35.0>
  181.  
  182.    finish {
  183.       ambient 0.1
  184.       diffuse 0.6
  185.       reflection 0.1
  186.       refraction 1.0
  187.       ior 1.5
  188.       brilliance 2.0
  189.    }
  190.    pigment { colour red 0.3 green 0.5 blue 0.3 filter 1.0 }
  191. }
  192.  
  193. /*The desk lamp*/
  194.  
  195. union {
  196.    object {
  197.       intersection {
  198.          object { Cylinder_Y scale <3.0, 1.0, 3.0> }
  199.          plane { y, 40.0 }
  200.          plane { y, -18.0 inverse }
  201.       }
  202.  
  203.       finish {
  204.          Shiny
  205.          crand 0.05
  206.          ambient 0.2
  207.          diffuse 0.7
  208.       }
  209.       pigment { colour red 0.7 green 0.6 blue 0.1 }
  210.    }
  211.  
  212.    intersection {
  213.       object { Cylinder_Y scale <25.0, 1.0, 25.0> }
  214.       plane { y, 2.0 }
  215.       plane { y, -2.0 inverse }
  216.  
  217.       translate <0.0, -16.0, -5.0>
  218.  
  219.       finish {
  220.          crand 0.05
  221.          ambient 0.3
  222.          diffuse 0.6
  223.          reflection 0.4
  224.          brilliance 4.0
  225.       }
  226.       normal { bumps 0.1 }
  227.       pigment { colour red 0.5 green 0.4 blue 0.1 }
  228.    }
  229.  
  230.    intersection {
  231.       object { Cylinder_X scale <1.0, 10.0, 10.0> }
  232.       object { Cylinder_X scale <1.0, 9.95, 9.95> inverse }
  233.       plane { y, 0.0 inverse }
  234.       plane { x, -30.0 inverse }
  235.       plane { x, 30.0 }
  236.  
  237.       translate <0.0, 35.0, -13.0>
  238.  
  239.       finish {
  240.          Shiny
  241.          crand 0.05
  242.          ambient 0.5
  243.          diffuse 0.5
  244.          reflection 0.3
  245.          brilliance 4.0
  246.       }
  247.       pigment { DarkGreen }
  248.    }
  249.  
  250.    union {
  251.       intersection {
  252.          sphere { <-30.0, 35.0, -13.0>, 10.0 }
  253.          sphere { <-30.0, 35.0, -13.0>, 9.95 inverse }
  254.          plane { y, 35.0 inverse }
  255.          plane { x, -30.0 }
  256.       }
  257.       intersection {
  258.          plane { y, 35.0 inverse }
  259.          plane { x, 30.0 inverse }
  260.          sphere { <30.0, 35.0, -13.0>, 10.0 }
  261.          sphere { <30.0, 35.0, -13.0>, 9.95 inverse }
  262.       }
  263.  
  264.       finish {
  265.          Shiny
  266.          crand 0.05
  267.          ambient 0.2
  268.          diffuse 0.7
  269.       }
  270.       pigment { colour red 0.7 green 0.6 blue 0.1 }
  271.    }
  272.  
  273.    rotate 35*y
  274.    translate <50.0, 0.0, 30.0>
  275. }
  276.  
  277. /*The fluorescent tube inside the lamp*/
  278.  
  279. light_source {
  280.     <0, 0, 0> color White
  281.  
  282.     looks_like {
  283.        intersection {
  284.           object { Cylinder_X }
  285.           plane { x, -25.0 inverse }
  286.           plane { x,  25.0 }
  287.  
  288.           pigment { White }
  289.           finish { ambient 1 diffuse 0 }
  290.       }
  291.    }
  292.  
  293.    translate <0.0, 43.0, -10.0>
  294.    rotate 35*y
  295.    translate <50.0, 0.0, 30.0>
  296. }
  297.  
  298. /*The Picture itself*/
  299.  
  300. union {
  301.    intersection {
  302.       plane { x,  1.0 }
  303.       plane { x, -1.0 inverse }
  304.       plane { y,  1.0 }
  305.       plane { y, -1.0 inverse }
  306.       plane { z,  1.0 }
  307.       plane { z, -1.0 inverse }
  308.  
  309.       translate <1.0, 1.0, 1.0>
  310.       scale <20.0, 15.0, 1.0>
  311.  
  312.       finish {
  313.          ambient 0.05
  314.          diffuse 0.9
  315.       }
  316.       pigment {
  317.          image_map { gif "rough.gif" once interpolate 2.0 }
  318.          scale <40.0, 30.0, 1.0>
  319.          scale <1.5, 1.5, 1.0>
  320.       }
  321.    }
  322.  
  323.    /* The picture frame */
  324.    union {
  325.       intersection {
  326.          union {
  327.             object { Cylinder_Y translate 41*x }
  328.             object { Cylinder_Y translate -1*x }
  329.          }
  330.          plane { y, 31.0 }
  331.          plane { y, -1.0 inverse }
  332.       }
  333.       intersection {
  334.          union {
  335.             object { Cylinder_X translate 31*y }
  336.             object { Cylinder_X translate -1*y }
  337.          }
  338.          plane { x, 41.0 }
  339.          plane { x, -1.0 inverse }
  340.       }
  341.       sphere { <-1.0, -1.0, 0.0>, 1.0 }
  342.       sphere { <-1.0, 31.0, 0.0>, 1.0 }
  343.       sphere { <41.0, -1.0, 0.0>, 1.0 }
  344.       sphere { <41.0, 31.0, 0.0>, 1.0 }
  345.  
  346.       finish {
  347.          Shiny
  348.          crand 0.05
  349.          ambient 0.3
  350.          diffuse 0.7
  351.       }
  352.       pigment { colour red 0.6 green 0.5 blue 0.1 }
  353.    }
  354.  
  355.    scale 1.5
  356.    rotate <10.0, -35.0, 0.0>
  357.    translate <-65.0, -15.0, -25.0>
  358. }
  359.  
  360. /*The pencil holder*/
  361. union {
  362.    intersection {
  363.       object { Cylinder_Y scale <5.0, 1.0, 5.0> }
  364.       object { Cylinder_Y scale <4.8, 1.0, 4.8> inverse }
  365.       plane { y, 0.0 inverse }
  366.       plane { y, 15.0 rotate -45*x }
  367.  
  368.       finish {
  369.          Shiny
  370.          crand 0.05
  371.          ambient 0.3
  372.          diffuse 0.7
  373.          reflection 0.4
  374.          brilliance 6.0
  375.       }
  376.       pigment { colour red 0.7 green 0.6 blue 0.1 }
  377.    }
  378.    object {
  379.       RedPencil
  380.       rotate -2*z
  381.       translate <1.0, 0.0, 1.0>
  382.    }
  383.    object {
  384.       GreenPencil
  385.       rotate 2.0*z
  386.       translate <-1.0, 3.0, 0.0>
  387.    }
  388.    object { 
  389.       BluePencil
  390.       rotate <-2.0, 0.0, 3.0>
  391.       translate <0.0, -2.0, -1.0>
  392.    }
  393.  
  394.    bounded_by {
  395.       intersection {
  396.          object { Cylinder_Y scale <6.0, 1.0, 6.0> }
  397.          plane { y, 36.0 }
  398.          plane { y, -4.0 inverse }
  399.       }
  400.    }
  401.  
  402.    rotate 45*y
  403.    translate <70.0, -18.0, -20.0>
  404. }
  405.  
  406. /*The light source*/
  407.  
  408. light_source { <20.0, 100.0, -200.0> colour White }
  409.