home *** CD-ROM | disk | FTP | other *** search
/ Mega A/V / mega_av.zip / mega_av / GRAPHUTL / POVSCN.ZIP / LEVEL3.ZIP / SNACK.POV < prev    next >
Text File  |  1992-07-03  |  12KB  |  519 lines

  1. // Persistence Of Vision raytracer version 1.0 sample file.
  2.  
  3. // By Tom Price
  4.  
  5. #include "shapes.inc"
  6. #include "colors.inc"
  7. #include "textures.inc"
  8.  
  9. camera {
  10.    location <0.0 50.0 -150.0>
  11.    up <0.0 1.0 0.0>
  12.    right <1.3333 0.0 0.0>
  13.    look_at <0.0 0.0 0.0>
  14. }
  15.  
  16.  
  17. object {
  18.    light_source { <50.0 150.0 -250.0>
  19.       colour White
  20.    }
  21. }
  22.  
  23. object {
  24.    light_source { <-50.0 150.0 -250.0>
  25.       colour White
  26.    }
  27. }
  28.  
  29.  
  30. /*The Sky*/
  31. object {
  32.    sphere { <0.0 -49000.0 -200.0> 50000.0 inverse }
  33.    texture { 
  34.       Bright_Blue_Sky
  35.       0.05 
  36.       scale <5000.0 1000.0 5000.0>
  37.       ambient 0.7
  38.       diffuse 0.0
  39.    }
  40.    colour SkyBlue
  41. }
  42.  
  43. /* The wood grain tabletop */
  44. object {
  45.    intersection {
  46.       plane { <1.0 0.0 0.0> 1.0 }
  47.       plane { <1.0 0.0 0.0> -1.0 inverse }
  48.       plane { <0.0 1.0 0.0> 1.0 }
  49.       plane { <0.0 1.0 0.0> -1.0 inverse }
  50.       plane { <0.0 0.0 1.0> 1.0 }
  51.       plane { <0.0 0.0 1.0> -1.0 inverse }
  52.    }
  53.    texture {
  54.       Pine_Wood
  55.       scale <7.0 1.0 0.7>
  56.       rotate <0.0 -30.0 0.0>
  57.       ambient 0.1
  58.       diffuse 0.5
  59.       reflection 0.3
  60.       brilliance 3.0
  61.    }
  62.    bounded_by {
  63.       intersection {
  64.          plane { <1.0 0.0 0.0> 1.01 }
  65.          plane { <1.0 0.0 0.0> -1.01 inverse }
  66.          plane { <0.0 1.0 0.0> 1.01 }
  67.          plane { <0.0 1.0 0.0> -1.01 inverse }
  68.          plane { <0.0 0.0 1.0> 1.01 }
  69.          plane { <0.0 0.0 1.0> -1.01 inverse }
  70.       }
  71.    }
  72.    scale <200.0 1.0 200.0>
  73.    translate <0.0 -42.0 0.0>
  74. }
  75.  
  76.  
  77. /* a salami */
  78. #declare
  79. Salami = composite {
  80.    /* the outside skin */
  81.    object {
  82.       union {
  83.          intersection {
  84.             quadric { Cylinder_X scale <1.0 20.0 20.0> }
  85.             plane { <1.0 0.0 0.0> 10.0 }
  86.             plane { <1.0 0.0 0.0> -10.0 inverse }
  87.          }
  88.          sphere { <-10.0 0.0 0.0> 20.0 }
  89.       }
  90.       texture {
  91.          0.05
  92.          colour red 0.5 green 0.2 blue 0.2
  93.          ambient 0.1
  94.          diffuse 0.8
  95.          reflection 0.2
  96.          brilliance 3.0
  97.          phong 0.3
  98.          phong_size 20.0
  99.       }
  100.       colour red 0.5 green 0.2 blue 0.2
  101.    }
  102.    object {
  103.       intersection {
  104.          quadric { Cylinder_X scale <1.0 19.0 19.0> }
  105.          plane { <1.0 0.0 0.0> 10.01 }
  106.          plane { <1.0 0.0 0.0> -10.0 inverse }
  107.       }
  108.       texture {
  109.          0.1
  110.          colour Pink
  111.          ambient 0.3
  112.          diffuse 0.7
  113.       }
  114.       colour Pink
  115.    }
  116.    bounded_by {
  117.       intersection {
  118.          quadric { Cylinder_X scale <1.0 20.01 20.01> }
  119.          plane { <1.0 0.0 0.0> 10.02 }
  120.          plane { <1.0 0.0 0.0> -30.01 inverse }
  121.       }
  122.    }
  123. }
  124.  
  125. /* a salami slice */
  126. #declare
  127. Slice = composite {
  128.    /* the outside skin */
  129.    object {
  130.       intersection {
  131.          quadric { Cylinder_X scale <1.0 20.0 20.0> }
  132.          plane { <1.0 0.0 0.0> 0.5 }
  133.          plane { <1.0 0.0 0.0> -0.5 inverse }
  134.       }
  135.       texture {
  136.          0.05
  137.          colour red 0.5 green 0.2 blue 0.2
  138.          ambient 0.1
  139.          diffuse 0.8
  140.          reflection 0.2
  141.          brilliance 3.0
  142.          phong 0.3
  143.          phong_size 20.0
  144.       }
  145.       colour red 0.5 green 0.2 blue 0.2
  146.    }
  147.    object {
  148.       intersection {
  149.          quadric { Cylinder_X scale <1.0 19.0 19.0> }
  150.          plane { <1.0 0.0 0.0> 0.51 }
  151.          plane { <1.0 0.0 0.0> -0.51 inverse }
  152.       }
  153.       texture {
  154.          0.1
  155.          ambient 0.3
  156.          diffuse 0.7
  157.          colour Pink
  158.       }
  159.       colour Pink
  160.    }
  161.    bounded_by {
  162.       intersection {
  163.          quadric { Cylinder_X scale <1.0 20.01 20.01> }
  164.          plane { <1.0 0.0 0.0> 0.52 }
  165.          plane { <1.0 0.0 0.0> -0.52 inverse }
  166.       }
  167.    }
  168. }
  169.  
  170.  
  171. /* a wedge of cheese*/
  172. #declare
  173. Cheese = object {
  174.    intersection {
  175.       quadric { Cylinder_Y scale <10.0 1.0 10.0> }
  176.       plane { <0.0 1.0 0.0> 20.0 }
  177.       plane { <0.0 1.0 0.0> 0.0 inverse }
  178.       plane { <1.0 0.0 0.0>  5.0 rotate <0.0 30.0 0.0> }
  179.       plane { <1.0 0.0 0.0> -5.0 rotate <0.0 -30.0 0.0> inverse }
  180.       quadric { Cylinder_X scale <1.0 1.0 1.5>
  181.          rotate <0.0 -20.0 30>
  182.          translate <0.0 10.0 0.0>
  183.          inverse
  184.       }
  185.       quadric { Cylinder_X scale <1.0 2.0 1.5>
  186.          rotate <0.0 20.0 -30>
  187.          translate <0.0 12.0 -4.0>
  188.          inverse
  189.       }
  190.       quadric { Cylinder_X scale <1.0 1.0 1.0>
  191.          translate <0.0 15.0 -9.0>
  192.          inverse
  193.       }
  194.       quadric { Cylinder_X scale <1.0 2.0 1.5>
  195.          rotate <0.0 -30.0 -30.0>
  196.          translate <0.0 15.0 5.0>
  197.          inverse
  198.       }
  199.       quadric { Cylinder_X scale <1.0 1.5 1.5>
  200.          rotate <0.0 0.0 -20.0>
  201.          translate <0.0 7.0 -9.0>
  202.          inverse
  203.       }
  204.       quadric { Cylinder_X scale <1.0 1.0 1.0>
  205.          rotate <0.0 10.0 10.0>
  206.          translate <0.0 10.0 -2.0>
  207.          inverse }
  208.       quadric { Cylinder_X scale <1.0 1.0 1.2>
  209.          rotate <0.0 -10.0 0.0>
  210.          translate <0.0 5.0 0.0>
  211.          inverse
  212.       }
  213.       quadric { Cylinder_X scale <1.0 1.3 1.0>
  214.          translate <0.0 3.0 -3.0>
  215.          inverse
  216.       }
  217.    }
  218.    texture {
  219.       0.05
  220.       colour red 1.0 green 0.8 blue 0.0
  221.       ambient 0.2
  222.       diffuse 0.8
  223.    }
  224.    colour red 1.0 green 0.8 blue 0.0
  225.    bounded_by {
  226.       intersection {
  227.          quadric { Cylinder_Y scale <10.01 1.0 10.01> }
  228.          plane { <0.0 1.0 0.0> 20.01 }
  229.          plane { <0.0 1.0 0.0> -0.01 inverse }
  230.       }
  231.    }
  232. }
  233.  
  234. /* a slice of cheese*/
  235. #declare
  236. CheeseSlice = object {
  237.    intersection {
  238.       quadric { Cylinder_Y scale <10.0 1.0 10.0> }
  239.       plane { <0.0 1.0 0.0> 20.0 }
  240.       plane { <0.0 1.0 0.0> 0.0 inverse }
  241.       plane { <1.0 0.0 0.0>  0.2  }
  242.       plane { <1.0 0.0 0.0> -0.2 inverse }
  243.       quadric { Cylinder_X scale <1.0 1.0 1.5>
  244.          rotate <0.0 -20.0 30>
  245.          translate <0.0 10.0 0.0>
  246.          inverse
  247.       }
  248.       quadric { Cylinder_X scale <1.0 2.0 1.5>
  249.          rotate <0.0 20.0 -30>
  250.          translate <0.0 12.0 -4.0>
  251.          inverse
  252.       }
  253.       quadric { Cylinder_X scale <1.0 1.0 1.0>
  254.          translate <0.0 15.0 -9.0>
  255.          inverse
  256.       }
  257.       quadric { Cylinder_X scale <1.0 2.0 1.5>
  258.          rotate <0.0 -30.0 -30.0>
  259.          translate <0.0 15.0 5.0>
  260.          inverse
  261.       }
  262.       quadric { Cylinder_X scale <1.0 1.5 1.5>
  263.          rotate <0.0 0.0 -20.0>
  264.          translate <0.0 7.0 -9.0>
  265.          inverse
  266.       }
  267.       quadric { Cylinder_X scale <1.0 1.0 1.0>
  268.          rotate <0.0 10.0 10.0>
  269.          translate <0.0 10.0 -2.0>
  270.          inverse
  271.       }
  272.       quadric { Cylinder_X scale <1.0 1.0 1.2>
  273.          rotate <0.0 -10.0 0.0>
  274.          translate <0.0 3.0 5.0>
  275.          inverse
  276.       }
  277.       quadric { Cylinder_X scale <1.0 1.3 1.0>
  278.          rotate <0.0 0.0 0.0>
  279.          translate <0.0 2.0 2.0>
  280.          inverse
  281.       }
  282.    }
  283.    texture {
  284.       0.05
  285.       colour red 1.0 green 0.8 blue 0.0
  286.       ambient 0.2
  287.       diffuse 0.8
  288.    }
  289.    colour red 1.0 green 0.8 blue 0.0
  290.    bounded_by {
  291.       intersection {
  292.          quadric { Cylinder_Y scale <10.01 1.0 10.01> }
  293.          plane { <0.0 1.0 0.0> 20.01 }
  294.          plane { <0.0 1.0 0.0> -0.01 inverse }
  295.          plane { <1.0 0.0 0.0> 0.3 }
  296.          plane { <1.0 0.0 0.0> -0.3 inverse }
  297.       }
  298.    }
  299. }
  300.  
  301. /* An oval glass dish */
  302. #declare
  303. Dish = object {
  304.    union {
  305.       intersection {
  306.          quadric { Ellipsoid scale <100.0 25.0 25.0> }
  307.          quadric { Ellipsoid scale <95.0 24.0 24.0> inverse }
  308.          plane { <0.0 1.0 0.0> 0.0 }
  309.          plane { <0.0 1.0 0.0> -5.0 inverse }
  310.       }
  311.       intersection {
  312.          quadric { Cylinder_Y scale <95.0 1.0 24.0> }
  313.          plane { <0.0 1.0 0.0> -4.0 }
  314.          plane { <0.0 1.0 0.0> -5.0 inverse }
  315.       }
  316.    }
  317.    texture {
  318.       colour Clear
  319.       ambient 0.1
  320.       diffuse 0.8
  321.       refraction 0.95
  322.       ior 1.5
  323.       reflection 0.05
  324.       brilliance 2.0
  325.    }
  326.    colour Clear
  327.    bounded_by {
  328.       intersection {
  329.          quadric { Cylinder_Y scale <100.01 1.0 25.01> }
  330.          plane { <0.0 1.0 0.0> 0.01 }
  331.          plane { <0.0 1.0 0.0> -5.01 inverse }
  332.       }
  333.    }
  334. }
  335.  
  336. /* a slice of bread */
  337. #declare
  338. BreadSlice = composite {
  339.    object {
  340.       union {
  341.          intersection {
  342.             plane { <1.0 0.0 0.0> 10.0 }
  343.             plane { <1.0 0.0 0.0> -10.0 inverse }
  344.             plane { <0.0 1.0 0.0> 1.0 }
  345.             plane { <0.0 1.0 0.0> -1.0 inverse }
  346.             plane { <0.0 0.0 1.0> 10.0 }
  347.             plane { <0.0 0.0 1.0> -10.0 inverse }
  348.          }
  349.          intersection {
  350.             quadric { Cylinder_Y scale <11.0 1.0 7.0>
  351.                translate <0.0 0.0 10.0>
  352.             }
  353.             plane { <0.0 1.0 0.0> 1.0 }
  354.             plane { <0.0 1.0 0.0> -1.0 inverse }
  355.          }
  356.       }
  357.       texture {
  358.          0.05
  359.          colour red 0.4 green 0.3 blue 0.1
  360.          ambient 0.3
  361.          diffuse 0.7
  362.          reflection 0.1
  363.          brilliance 2.0
  364.       }
  365.       colour red 0.4 green 0.3 blue 0.1
  366.    }
  367.  
  368.    object {
  369.       union {
  370.          intersection {
  371.             plane { <1.0 0.0 0.0> 9.5 }
  372.             plane { <1.0 0.0 0.0> -9.5 inverse }
  373.             plane { <0.0 1.0 0.0> 1.01 }
  374.             plane { <0.0 1.0 0.0> -1.01 inverse }
  375.             plane { <0.0 0.0 1.0> 9.5 }
  376.             plane { <0.0 0.0 1.0> -9.5 inverse }
  377.          }
  378.          intersection {
  379.             quadric { Cylinder_Y scale <10.5 1.0 6.5>
  380.                translate <0.0 0.0 10.0>
  381.             }
  382.             plane { <0.0 1.0 0.0> 1.01 }
  383.             plane { <0.0 1.0 0.0> -1.01 inverse }
  384.          }
  385.       }
  386.       texture {
  387.          0.1
  388.          colour red 0.7 green 0.6 blue 0.45
  389.          ambient 0.3
  390.          diffuse 0.7
  391.       }
  392.       colour red 0.7 green 0.6 blue 0.45
  393.    }
  394.    bounded_by {
  395.       intersection {
  396.          plane { <1.0 0.0 0.0> 10.1 }
  397.          plane { <1.0 0.0 0.0> -10.1 inverse }
  398.          plane { <0.0 1.0 0.0> 1.0 }
  399.          plane { <0.0 1.0 0.0> -1.1 inverse }
  400.          plane { <0.0 0.0 1.0> 17.1 }
  401.          plane { <0.0 0.0 1.0> -10.1 inverse }
  402.       }
  403.    }
  404. }    
  405.  
  406. /* Now to put the scene together*/
  407. composite {
  408.    object { Dish
  409.       scale <0.7 1.0 1.2>
  410.       translate <0.0 -36.0 -25.0>
  411.    }
  412.  
  413.    composite { Salami
  414.       rotate <0.0 35.0 0.0>
  415.       translate <-30.0 -20.0 -20.0>
  416.    }
  417.  
  418.    object { Cheese
  419.       scale <2.0 2.0 2.0>
  420.       rotate <0.0 25.0 0.0>
  421.       translate <30.0 -40.0 -25.0>
  422.    }
  423.    translate <0.0 0.0 25.0>
  424.    rotate <0.0 -15.0 0.0>
  425.    translate <-35.0 0.0 20.0>
  426. }
  427.  
  428. /* now a sandwich */
  429. composite {
  430.    composite { Slice
  431.       rotate <0.0 90.0 0.0>
  432.       rotate <90.0 0.0 0.0>
  433.       translate <45.0 -33.0 -35.0>
  434.    }
  435.  
  436.    object { CheeseSlice
  437.       scale <1.0 2.0 2.0>
  438.       rotate <0.0 -90.0 0.0>
  439.       rotate <90.0 0.0 0.0>
  440.       translate <0.0 0.0 -16.0>
  441.       rotate <0.0 30.0 0.0>
  442.       translate <45.0 -35.0 -35.0>
  443.    }
  444.  
  445.    composite { BreadSlice
  446.       scale <1.6 2.0 1.0>
  447.       rotate <0.0 -150.0 0.0>
  448.       translate <45.0 -38.0 -35.0>
  449.    }
  450.  
  451.    composite { BreadSlice
  452.       scale <1.6 2.0 1.0>
  453.       rotate <0.0 -150.0 0.0>
  454.       translate <45.0 -29.0 -35.0>
  455.    }
  456.    translate <0.0 15.0 10.0>
  457. }
  458.  
  459. /*spotlight on the sandwich*/
  460. object {
  461.    intersection {
  462.       quadric { Cylinder_Y scale <7.5 1.0 7.5> }
  463.       quadric { Cylinder_Y scale <7.4 1.0 7.4> inverse }
  464.       plane { <0.0 1.0 0.0> 50.0 }
  465.       plane { <0.0 1.0 0.0> 0.0 inverse }
  466.    }
  467.    translate <45.0 100.0 -25.0>
  468.    texture {
  469.       colour White
  470.       ambient 0.3
  471.       diffuse 0.7
  472.    }
  473.    colour White
  474. }
  475.  
  476. object {
  477.    light_source { <45.0 145.0 -25.0>
  478.       colour White
  479.    }
  480. }
  481.  
  482. composite { Slice
  483.    rotate <0.0 90.0 0.0>
  484.    rotate <65.0 0.0 0.0>
  485.    translate <-30.0 25.0 45.0>
  486. }
  487.  
  488. composite { Slice
  489.    rotate <0.0 90.0 0.0>
  490.    rotate <60.0 0.0 0.0>
  491.    translate <35.0 25.0 25.0>
  492. }
  493.  
  494. object { CheeseSlice
  495.    scale <1.0 2.0 2.0>
  496.    rotate <0.0 -90.0 0.0>
  497.    rotate <50.0 0.0 0.0>
  498.    translate <-20.0 35.0 30.0>
  499. }
  500.  
  501. object { CheeseSlice
  502.    scale <1.0 2.0 2.0>
  503.    rotate <0.0 -90.0 0.0>
  504.    rotate <70.0 0.0 0.0>
  505.    translate <65.0 15.0 35.0>
  506. }
  507.  
  508. composite { BreadSlice
  509.    scale <1.6 2.0 1.0>
  510.    rotate <-40.0 -60.0 0.0>
  511.    translate <-60.0 25.0 35.0>
  512. }
  513.  
  514. composite { BreadSlice
  515.    scale <1.6 2.0 1.0>
  516.    rotate <60.0 50.0 0.0>
  517.    translate <70.0 0.0 30.0>
  518. }
  519.