home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / raytrace / rayce27 / ezprezzo.r < prev    next >
Encoding:
Text File  |  1994-01-12  |  11.2 KB  |  550 lines

  1. // A scene I originally made for PoV 1.0, converted to Rayce.
  2.  
  3. /*  This is ezprezzo.pov, a datafile for rendering an
  4.     espressomaker. The silly name was chosen to avoid
  5.     confusion: It is not the NFF dataset by Todd Elvins, it
  6.     is not the espresso by Lex van der Sluijs (called S-presso)
  7.     Because my computer is rather slow, I have taken great
  8.     pains to make it as fast possible.
  9.  
  10.     It was made by
  11.  
  12.         Han-Wen Nienhuys
  13.  
  14.     If you have suggestions, or modifications, please
  15.     let me know, I am reachable by e-mail at
  16.  
  17.         hanwen@stack.urc.tue.nl
  18.  
  19.     or
  20.  
  21.         wsadjw@urc.tue.nl
  22.  
  23.     (don't forget to mention your mail is for me; it's not my account)
  24.     or by snailmail at
  25.  
  26.         Dommelseweg 1a
  27.         5581 VA Waalre, Holland.
  28.  
  29. */
  30.  
  31.  
  32. #include "colors.inc"
  33. #include "shapes.inc"
  34.  
  35.  
  36. #declare Shiny = texture { specular 1.0 roughness 0.01 }
  37. #declare Dull = texture { specular 0.5 roughness 0.15   }
  38.  
  39. /****************/
  40. /**** CAMERA ****/
  41. /****************/
  42.  
  43. #declare overview = camera {
  44.     location <10, 40, -50>
  45.     direction <0, 3.5, 0>
  46.     aspect 1.333
  47.     sky <0, 1, 0>
  48.     look_at <0, 4, 0>
  49. }
  50.  
  51. #declare zoomin = camera {
  52.     location <15, 23, -40>
  53.     direction <0, 2.8, 0>
  54.     aspect 1.333
  55.     sky <0, 1, 0>
  56.     look_at <0, 8.5, 0>
  57.     fov 30
  58. }
  59.  
  60. camera { zoomin }
  61.  
  62. options {
  63.   iterations 1
  64. }
  65.  
  66. /****************/
  67. /**** LIGHTS ****/
  68. /****************/
  69.  
  70. #declare brightlight = color red 1.5 green 1.4 blue 0.0
  71.     // VERY bright yellow
  72.  
  73. object {
  74.     light_source {
  75.       <4, 30, 0>
  76.       color brightlight
  77.       spotlight
  78.       point_at <0, 1, 0>
  79. //      radius 22
  80. //      falloff 34
  81.       tightness 0.26
  82.     }
  83. }
  84.  
  85. object {
  86.     light_source {
  87.         <10, 20, 0>
  88.         color White
  89.         spotlight
  90.         point_at <2, 3, 0>
  91. //        radius 24
  92. //        falloff 34
  93.         tightness 0.23
  94.         rotate <0, 10, 0>
  95.     }
  96. }
  97.  
  98. /**************/
  99. /*** ACTION ***/
  100. /**************/
  101.  
  102. /* modified chrome texture
  103.    the diffuse value is kept low otherwise,
  104.    the spoon looks like a yellow blob
  105. */
  106.  
  107. #declare Spoon_Texture = texture {
  108.    color LightGray
  109.    ambient 0.23
  110.    diffuse 0.10
  111.    reflection 0.9
  112.    brilliance 8.0
  113.    specular 0.8
  114.    roughness 0.01
  115.    refraction 0.0
  116.    refraction 0.0
  117. }
  118.  
  119.  
  120. #declare Coffee_Text =
  121. texture {
  122.     color Black
  123.     diffuse 0.3
  124.     specular 1.0 roughness 0.01
  125.     brilliance 5
  126. //    dents 0.7
  127.     scale <0.5, 0.2, 0.5>
  128.     reflection 0.5
  129.     refraction 0.0
  130. }
  131.  
  132. #declare Sugar_Text =
  133. texture {
  134.      color Quartz
  135.      specular 1.0
  136.      roughness 0.01
  137. //    metallic
  138.     ambient 0.4
  139.     diffuse 0.5
  140.     brilliance 2
  141.     reflection 0.1          /* needed for contrast */
  142. //    wrinkles 0.8            /* grainy surface */
  143.     scale <0.12, 0.12, 0.12>
  144.     refraction 0.0
  145. }
  146.  
  147. #declare Brown_Ceramic = texture {
  148.     colour Brown
  149.     specular 1.0 
  150.     roughness 0.01
  151.     reflection color rgb 0.2 * <1,1,1>
  152.     brilliance 3.0
  153.     diffuse 0.3
  154.     ambient 0.3
  155.     refraction 0.0
  156. }
  157.  
  158. #declare Cup_Texture = texture {
  159.   Brown_Ceramic
  160. }
  161.  
  162. /* metallic texture */
  163. #declare Gray_Metal =
  164. texture {
  165.     colour Silver
  166.     specular 1.0
  167.     roughness 0.01
  168. //    metallic
  169.     brilliance 5.0
  170.     diffuse 0.7
  171.     ambient 0.3
  172.     reflection color rgb 0.3 * <1,1,1>
  173.     refraction 0.0
  174. }
  175.  
  176. #declare Espresso_Metal = texture { Gray_Metal }
  177.  
  178. #declare Black_plastic = texture {
  179.     specular color Grey50
  180.     roughness 0.15
  181.     brilliance 0.3
  182.     colour Black
  183.     diffuse 0.4
  184.     ambient 0.6                 /* ambient black ?! [yup :) ] */
  185.     refraction 0.0
  186.     reflection 0.0
  187. }
  188.  
  189. /**************************** OBJECTS ****************************************/
  190. /* ESPRESSO MACHINE */
  191.  
  192.  
  193. /*
  194.  * handle, points at the -Z axis
  195.  */
  196.  
  197. #declare handle =       /* handle */
  198. composite {
  199.         /* metal part of the handle */
  200.         intersection {
  201.             quadric { QCone_Z scale <1, 1, 15> }
  202.             plane { <0, 0, 1>, -8.5 }
  203.             plane { <0, 0, -1>, 15 }
  204.         }
  205.         /* black cap */
  206.       intersection {
  207.             Disk_Z
  208.         scale <1, 1, 0.5>
  209.             translate <0, 0, -15>
  210.         texture {
  211.             Black_plastic
  212.         }
  213.       }
  214.  
  215.     translate <0, 0, 8.5>
  216. }
  217.  
  218. /*
  219.     middle part. Dimensions:
  220.     height: 7.95
  221.     bottom radius: 3.858
  222.     top radius: 3.154218
  223. */
  224.  
  225. #declare espart =           /* middle part */
  226. composite {
  227.     object {
  228.       union {
  229.         intersection {
  230.             intersection {  /* body */
  231.                 quadric { QCone_Y scale <4.3, 48.6, 4.3> }
  232.                 quadric { QCone_Y scale <4.2, 48.6, 4.2> inverse }
  233.                 plane { <0, 1, 0>, -35.65 }
  234.                 plane { <0, -1, 0>, 43.6 }
  235.                 translate <0, 43.6, 0>
  236.             }
  237.             intersection {  /* take a bite out of it */
  238.                 plane { <0, -1, -1>, 0 }
  239.                 plane { <0, -1, 1>, 0 }
  240.                 plane { <-1, 0, 0>, 0 }
  241.                 translate <0, 7, 0>
  242.                 inverse
  243.             }
  244.         }
  245.  
  246.         /* ...; it points at +X axis. */
  247.         intersection {
  248.             plane { <1, -1, -1>, 0 }
  249.             plane { <1, -1, 1>, 0 }
  250.             intersection {
  251.                 plane { <1, -1, -1>, -0.2 }
  252.                 plane { <1, -1, 1>, -0.2 }
  253.                 inverse
  254.             }
  255.             plane { <0, 1, 0>, 1 }
  256.             plane { <-1, 0, 0>, 0.5 }
  257.             translate <3.15, 7, 0>
  258.         }        
  259.       }
  260.       bounded_by { sphere { <0, 4, 0>, 6 } }        
  261.     }
  262.     composite {
  263.         handle
  264.         translate <0, 5, -2.6>
  265.     }
  266. }
  267.  
  268. /*
  269.     Bottom part; this normally contains water. Dimensions:
  270.  
  271.     height: 5.00
  272.     top radius: 3.858
  273.     bottom radius: 4.300
  274. */
  275.  
  276. #declare esbot = composite {             /* bottom part */
  277.     object {
  278.         intersection {      /* body */
  279.             quadric { QCone_Y scale <4.3, 48.6, 4.3> }
  280.             quadric { QCone_Y scale <4.2, 48.6, 4.2> inverse }
  281.             plane { <0, 1, 0>, -43.7 }
  282.             plane { <0, -1, 0>, 48.6 }
  283.             translate <0, 48.6, 0>
  284.         }
  285.         bounded_by {
  286.             sphere { <0, 2.5, 0>, 5 }
  287.         }
  288.     }
  289.     object {            /* safety valve */
  290.         intersection {
  291.             intersection { Hexagon scale <0.4, 0.5, 0.5> }
  292.             quadric { Cylinder_X scale <1, 0.3, 0.3> inverse }
  293.         }
  294.         bounded_by {
  295.             sphere { <0, 0, 0>, 1.5 }
  296.         }
  297.         translate <4.1, 3.5, 0>
  298.     }
  299. }
  300.  
  301. /*
  302.  * the lid on top of the espressomaker.
  303.  */
  304.  
  305. #declare escap =
  306. composite {
  307.     object {
  308.         intersection {  /* body */
  309.             plane { <0, -1, 0>, 0 }
  310.             sphere { <0, -1.3185, 0>, 3.4185 }
  311.             sphere { <0, -1.3185, 0>, 3.3 inverse }
  312.         }
  313.         bounded_by {
  314.             sphere { <0, -1.3185, 0>, 3.419 }
  315.         }
  316.     }
  317.  
  318.     composite {     /* the little knob on top */
  319.  
  320.              /* the black part */
  321.             intersection {
  322.                sphere { <0, 2.85, 0>, 0.75 }
  323.                quadric {
  324.                  Cylinder_Y scale <0.4, 1, 0.4> inverse
  325.                }
  326.                texture {
  327.                  Black_plastic
  328.                }
  329.             }
  330.  
  331.         /* metal core */
  332.         intersection {
  333.            sphere { <0, 2.85, 0>, 0.75 }
  334.            quadric { Cylinder_Y scale <0.4, 1, 0.4> }
  335.         }
  336.  
  337.         bounded_by {
  338.             sphere { <0, 2.85, 0>, 0.75 }
  339.         }
  340.     }
  341. }
  342.  
  343. /* glue everything together */
  344.  
  345. #declare espressomachine =
  346. composite {
  347.     composite {
  348.         espart
  349.         translate <0, 5, 0>
  350.     }
  351.     composite {
  352.         escap
  353.         translate <0, 13, 0>
  354.     }
  355.     composite {
  356.         esbot
  357.         translate <0, 0, 0>
  358.     }
  359.     texture { Espresso_Metal }
  360. }
  361.  
  362. /***********/
  363. /*** CUP ***/
  364. /***********/
  365.  
  366. #declare cupbody =                /* body */
  367. object {
  368.     union {
  369.         intersection {
  370.             intersection {            /* a Cylinder */
  371.                 Disk_Y scale <2.5, 5.5, 2.5>
  372.             }
  373.             quadric {            /* make it hollow */
  374.                 Cylinder_Y scale <2.1, 5.5, 2.1>
  375.                 inverse
  376.             }
  377.             translate <0, 1.1, 0>
  378.         }
  379.         intersection {                /* small stand */
  380.             quadric { QCone_Y scale <2, 4.1, 2> }
  381.             plane { <0, 1, 0>, 4.1 }
  382.             plane { <0, -1, 0>, -3 }
  383.             translate <0, -3, 0>
  384.         }
  385.     }
  386.     bounded_by { sphere { <0, 3.3, 0>, 4.2 } }
  387. }
  388.  
  389. #declare saucer =
  390. object {
  391.     intersection {
  392.         intersection {
  393.             sphere { <0, 4.85, 0>, 6.8 }
  394.             plane { <0, -1, 0>, 0 }
  395.         }
  396.         intersection {
  397.             sphere { <0, 7.58, 0>, 8.47 }
  398.             plane { <0, -1, 0>, -0.6 }
  399.             inverse
  400.         }
  401.         intersection {            /* place for the cup */
  402.             plane { <0, -1, 0>, -0.4 }
  403.             quadric { Cylinder_Y scale <2.1, 1, 2.1> }
  404.             inverse
  405.         }
  406.     }
  407.     bounded_by {
  408.         sphere { <0, 4.86, 0>, 6.81 }
  409.     }
  410. }
  411.  
  412.  
  413. #declare ear =
  414. object {
  415.     intersection {
  416.         torus { 1.5, 0.3
  417.       translate <-1.2, 0, 0>
  418.       scale <0.9, 1, 1>
  419.       rotate 90*x
  420.       sturm
  421.         }
  422.         plane { <1, 0, 0>, 0 }
  423.     }
  424. }
  425.  
  426. /* The hub on top of the cup
  427.  */
  428. #declare cupring = torus { 2.3, 0.2 sturm }
  429.  
  430. /****************/
  431. /* PARAFERNALIA */
  432. /****************/
  433.  
  434. #declare Coffee =               /* YESSS! Coffee, yummie ! */
  435. object {
  436.    plane { <0, 1, 0>, 0 }
  437.    clipped_by {
  438.         sphere { <0, 0, 0>, 2.2 }
  439.    }
  440.    texture {
  441.         Coffee_Text
  442.    }
  443. }
  444.  
  445.  
  446. #declare spoon = 
  447. composite {    
  448.     box { <-5, -0.2, -0.3>, <0, 0, 0.3> }
  449.     box { <0, -0.2, -0.3>, <0.5, 0, 0.3> rotate <0, 0, -30> } 
  450.     intersection {
  451.             quadric { Ellipsoid scale <1.5, 1.5, 1.5> }
  452.             quadric { Ellipsoid scale <1.4, 1.4, 1.4> inverse }
  453.             plane { <0, 1, 0>, -0.5 }
  454.             scale <0.75, 0.5, 0.75>
  455.             translate <1.14, 0, 0>
  456.     }    
  457.     
  458.     translate <0, 0.2, 0>
  459.     rotate <0, 0, 3>
  460.     texture {
  461.         Spoon_Texture
  462.     }
  463.     
  464.     bounded_by { box { <-5, -1.5, -2>, <4, 1, 2> } }
  465. }
  466.  
  467. #declare sugarcube =            /* a sugarcube */
  468. object {
  469.     box {
  470.         Cube
  471.         scale <1, 0.5, 0.75>
  472.         translate <0, 0.5, 0>
  473.     }
  474.     texture {
  475.         Sugar_Text
  476.     }
  477. }
  478.  
  479. /*****************************************************************************/
  480.  
  481. #declare cup =
  482. composite {
  483.     object {
  484.         cupbody
  485.     }
  486.     object {
  487.         ear
  488.         translate <-2.5, 3.3, 0>
  489.     }
  490.     torus {
  491.         cupring
  492.         translate <0, 6.6, 0>
  493.     }
  494. }
  495.  
  496.  
  497. #declare cupandsaucer =
  498. composite {
  499.     composite {
  500.         cup
  501.         translate <0, 0.4, 0>
  502.     }
  503.     object { saucer }
  504.     composite {
  505.         object {
  506.             sugarcube
  507.             translate <0, 0.4, -3.3>
  508.         }
  509.         object {
  510.             sugarcube
  511.             rotate <0, 20, 0>
  512.             translate <0, 0.4, -3.3>
  513.             rotate <0, 45, 0>
  514.         }
  515.         rotate <0, -55, 0>
  516.     }
  517.     composite {
  518.         spoon
  519.         rotate <0, 0, -10>
  520.         rotate <0, 90, 0>
  521.         translate <-4, 1.3, 0>
  522.         rotate <0, -50, 0>
  523.     }
  524.     texture { Cup_Texture }
  525. }
  526.  
  527. /*****************************************************************************/
  528. /* now, build the scene */
  529. composite {                             /* the Holy machine */
  530.     espressomachine
  531.     rotate <0, 20, 0>
  532.     translate <-6, 0, 5>
  533. }
  534.  
  535. composite {                             /* cup and thingies */
  536.     cupandsaucer
  537.     translate <6, 0, 2>
  538. }
  539.  
  540. object {                                /* floor */
  541.     plane { <0, 1, 0>, 0 }
  542.     texture {
  543.         colour Magenta
  544.         ambient 0.16
  545.         diffuse 0.84
  546.     reflection 0.0
  547.     refraction 0.0
  548.     }
  549. }
  550.