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

  1. // Persistence Of Vision raytracer version 3.1 sample file.
  2. // File by Tom Price, modified by Dan Farmer
  3. //
  4. //                         !! NOTE !!
  5. // Designed to be run as a 3-frame animation, which will generate the
  6. // self-including image_maps in the picture frame.  See DESK.INI.
  7. // Specifies .PNG format for the image_maps, so you may need to do
  8. // some editing if your standard output format is different than that.
  9.  
  10.  
  11. global_settings { assumed_gamma 2.2 }
  12.  
  13. #include "shapes.inc"
  14. #include "colors.inc"
  15. #include "textures.inc"
  16. #include "woods.inc"
  17. #include "glass.inc"
  18. #include "metals.inc"
  19.  
  20. #declare This_Brass = texture { T_Brass_4B }
  21.  
  22. #declare
  23. RedPencil = union {
  24.    cylinder {0, y*30, 0.5
  25.       finish {
  26.          crand 0.05
  27.          ambient 0.3
  28.          diffuse 0.7
  29.       }
  30.       pigment { Red }
  31.    }
  32.  
  33.    cylinder {0, y*32, 0.5
  34.       finish {
  35.          crand 0.05
  36.          ambient 0.3
  37.          diffuse 0.7
  38.       }
  39.       pigment { Tan }
  40.    }
  41. }
  42.  
  43. #declare GreenPencil =
  44. union {
  45.    cylinder {0, y*30, 0.5
  46.       finish {
  47.          crand 0.05
  48.          ambient 0.3
  49.          diffuse 0.7
  50.       }
  51.       pigment { Green }
  52.    }
  53.  
  54.    cylinder {0, y*32, 0.5
  55.       finish {
  56.          crand 0.05
  57.          ambient 0.3
  58.          diffuse 0.7
  59.       }
  60.       pigment { Tan }
  61.    }
  62. }
  63.  
  64. #declare BluePencil =
  65. union {
  66.    cylinder {0, y*30, 0.5
  67.       finish {
  68.          crand 0.05
  69.          ambient 0.3
  70.          diffuse 0.7
  71.       }
  72.       pigment { Blue }
  73.    }
  74.  
  75.    cylinder {0, y*32, 0.5
  76.       finish {
  77.          crand 0.05
  78.          ambient 0.3
  79.          diffuse 0.7
  80.       }
  81.       pigment { Tan }
  82.    }
  83. }
  84.  
  85. #declare Back_Wall =
  86. plane { z, 200.0
  87.       hollow on
  88.       finish {
  89.       crand 0.05
  90.       ambient 0.3
  91.       diffuse 0.7
  92.    }
  93.    pigment { LightGray }
  94. }
  95.  
  96. #declare Ceiling =
  97. plane { y,  500.0
  98.    hollow on
  99.    finish {
  100.       ambient 0.3
  101.       diffuse 0.7
  102.    }
  103.    pigment { White }
  104. }
  105.  
  106.  
  107. #declare Desk_Top =
  108. box { <-125, -2, -100> <125, 2, 100>
  109.    translate -20.0*y                     // top surface at -18*y
  110.    texture {
  111.       // T_Wood30
  112.       pigment { P_WoodGrain6A color_map { M_Wood6A }}
  113.       #if (clock=4)
  114.           finish { reflection 0.2 }
  115.       #end
  116.       rotate y*90
  117.       translate z*30
  118.       rotate z*5
  119.       scale 5
  120.    }
  121. }
  122.  
  123. #declare Blotter =
  124. union {
  125.    triangle {
  126.       <0.0, 0.0, 0.0>
  127.       <8.5, 0.0, 0.0>
  128.       <0.0, 0.0, -11.0>
  129.    }
  130.    triangle {
  131.       <0.0, 0.0, -11.0>
  132.       <8.5, 0.0, -11.0>
  133.       <8.5, 0.0, 0.0>
  134.    }
  135.  
  136.    scale <4.0, 1.0, 4.0>
  137.    rotate -30.0*y
  138.    translate <-20.0, -17.9999, -40.0>
  139.  
  140.    finish {
  141.       crand 0.04
  142.       ambient 0.15
  143.       diffuse 0.5
  144.    }
  145.    pigment { colour red 0.5 green 0.5 blue 0.3 }
  146. }
  147.  
  148. #declare Paperweight=
  149. intersection {
  150.    sphere { <0.0, -5.0, 0.0>, 10.0 }
  151.    disc { 0, -y, 10.1 }
  152.    translate <0.0, -17.9998, -35.0>
  153.    texture { T_Green_Glass }
  154. }
  155.  
  156.  
  157. /*The Picture itself*/
  158. #declare Picture =
  159. union {
  160.       box { -1, 1
  161.       translate <1.0, 1.0, 1.0>
  162.       scale <20.0, 15.0, 1.0>
  163.  
  164.       finish {
  165.          ambient 0.05
  166.          diffuse 0.9
  167.       }
  168.       pigment {
  169.          #switch(clock)
  170.          #case(4)
  171.              image_map { png "desk3.png" once interpolate 2.0 }
  172.              scale <40.0, 30.0, 1.0>
  173.              scale <1.5, 1.5, 1.0>
  174.              #break
  175.          #case(3)
  176.              image_map { png "desk2.png" once interpolate 2.0 }
  177.              scale <40.0, 30.0, 1.0>
  178.              scale <1.5, 1.5, 1.0>
  179.              #break
  180.          #case(2)
  181.              image_map { png "desk1.png" once interpolate 2.0 }
  182.              scale <40.0, 30.0, 1.0>
  183.              scale <1.5, 1.5, 1.0>
  184.              #break
  185.          #else
  186.              Gray50
  187.          #end
  188.       }
  189.    }
  190.  
  191.    /* The picture frame */
  192.    union {
  193.       cylinder {-y,31*y,1 translate 41*x }
  194.       cylinder {-y,31*y,1 translate -1*x }
  195.       cylinder {-x,41*x,1 translate 31*y }
  196.       cylinder {-x,41*x,1 translate -1*y }
  197.       sphere { <-1.0, -1.0, 0.0>, 1.0 }
  198.       sphere { <-1.0, 31.0, 0.0>, 1.0 }
  199.       sphere { <41.0, -1.0, 0.0>, 1.0 }
  200.       sphere { <41.0, 31.0, 0.0>, 1.0 }
  201.       texture { This_Brass }
  202.    }
  203.  
  204.    scale 1.5
  205.    rotate <10.0, -35.0, 0.0>
  206.    translate <-65.0, -15.0, -25.0>
  207. }
  208.  
  209. #declare Pencil_Holder =
  210. union {
  211.    intersection {
  212.       object { Cylinder_Y scale <5.0, 1.0, 5.0> }
  213.       object { Cylinder_Y scale <4.8, 1.0, 4.8> inverse }
  214.       plane { y, 0.0 inverse }
  215.       plane { y, 15.0 rotate -45*x }
  216.       texture { This_Brass }
  217.    }
  218.    object {
  219.       RedPencil
  220.       rotate -2*z
  221.       translate <1.0, 0.0, 1.0>
  222.    }
  223.    object {
  224.       GreenPencil
  225.       rotate 2.0*z
  226.       translate <-1.0, 3.0, 0.0>
  227.    }
  228.    object {
  229.       BluePencil
  230.       rotate <-2.0, 0.0, 3.0>
  231.       translate <0.0, -2.0, -1.0>
  232.    }
  233.    rotate 45*y
  234.    translate <70.0, -18.0, -20.0>
  235. }
  236.  
  237. #declare Lamp =
  238. union {
  239.    object {
  240.       cylinder { -y*18, y*40, 3 }
  241.       texture { This_Brass }
  242.    }
  243.    cylinder { -y*2, y*2, 25
  244. //    intersection {
  245. //       object { Cylinder_Y scale <25.0, 1.0, 25.0> }
  246. //       plane { y, 2.0 }
  247. //       plane { y, -2.0 inverse }
  248.  
  249.       translate <0.0, -16.0, -5.0>
  250.       texture { This_Brass
  251.          normal { bumps 0.1 }
  252.       }
  253.    }
  254.  
  255.    intersection {
  256.       object { Cylinder_X scale <1.0, 10.0, 10.0> }
  257.       object { Cylinder_X scale <1.0, 9.95, 9.95> inverse }
  258.       plane { y, 0.0 inverse }
  259.       plane { x, -30.0 inverse }
  260.       plane { x, 30.0 }
  261.  
  262.       translate <0.0, 35.0, -13.0>
  263.  
  264.       finish {
  265.          Shiny
  266.          crand 0.05
  267.          ambient 0.5
  268.          diffuse 0.5
  269.          reflection 0.3
  270.          brilliance 4.0
  271.       }
  272.       pigment { DarkGreen }
  273.    }
  274.  
  275.    union {
  276.       intersection {
  277.          sphere { <-30.0, 35.0, -13.0>, 10.0 }
  278.          sphere { <-30.0, 35.0, -13.0>, 9.95 inverse }
  279.          plane { y, 35.0 inverse }
  280.          plane { x, -30.0 }
  281.       }
  282.       intersection {
  283.          plane { y, 35.0 inverse }
  284.          plane { x, 30.0 inverse }
  285.          sphere { <30.0, 35.0, -13.0>, 10.0 }
  286.          sphere { <30.0, 35.0, -13.0>, 9.95 inverse }
  287.       }
  288.       texture { This_Brass }
  289.    }
  290.  
  291.    rotate 35*y
  292.    translate <50.0, 0.0, 30.0>
  293. }
  294.  
  295. /*The fluorescent tube inside the lamp*/
  296. #declare Lamp_Light_Source =
  297. light_source { <0, 0, 0> color White
  298.  
  299.     looks_like {
  300.        cylinder { -x*25, x*25, 2
  301.           pigment { White filter 0 }
  302.           finish { ambient 1 diffuse 0 }
  303.       }
  304.    }
  305.  
  306.    translate <0.0, 43.0, -10.0>
  307.    rotate 35*y
  308.    translate <50.0, 0.0, 30.0>
  309. }
  310. camera {
  311.    location <0.0, 40.0, -150.0>
  312.    up <0.0, 1.0, 0.0>
  313.    right <4/3, 0.0, 0.0>
  314.    look_at <0.0, 0.0, 0.0>
  315. }
  316.  
  317. light_source { <20.0, 100.0, -200.0> colour White }
  318.  
  319. object { Back_Wall }
  320. object { Ceiling }
  321. object { Desk_Top }
  322. object { Blotter }
  323. object { Paperweight }
  324. object { Lamp }
  325. object { Lamp_Light_Source }
  326. object { Picture }
  327. object { Pencil_Holder }
  328.