home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / MISC / PVDAT.ZIP / SNACK.DAT < prev    next >
Encoding:
Text File  |  1991-09-07  |  12.9 KB  |  537 lines

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