home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / MISC / PVDAT.ZIP / DESK.DAT < prev    next >
Encoding:
Text File  |  1991-09-07  |  9.1 KB  |  428 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. #declare
  10.   RedPencil = composite
  11.     object
  12.       intersection
  13.     quadric Cylinder_Y scale <0.5 1.0 0.5> end_quadric
  14.     plane <0.0 1.0 0.0> 30.0 end_plane
  15.     plane <0.0 1.0 0.0> 0.0 inverse end_plane
  16.       end_intersection
  17.       texture
  18.         0.05
  19.         ambient 0.3
  20.     diffuse 0.7
  21.     colour red 1.0
  22.       end_texture
  23.      end_object
  24.  
  25.      object
  26.        intersection
  27.     quadric Cylinder_Y scale <0.5 1.0 0.5> end_quadric
  28.     plane <0.0 1.0 0.0> 32.0 end_plane
  29.     plane <0.0 1.0 0.0> 30.0 inverse end_plane
  30.       end_intersection
  31.       texture
  32.         0.05
  33.         ambient 0.3
  34.     diffuse 0.7
  35.     colour Tan
  36.       end_texture
  37.       end_object
  38.    end_composite
  39.  
  40. #declare
  41.   GreenPencil = composite
  42.     object
  43.       intersection
  44.     quadric Cylinder_Y scale <0.5 1.0 0.5> end_quadric
  45.     plane <0.0 1.0 0.0> 30.0 end_plane
  46.     plane <0.0 1.0 0.0> 0.0 inverse end_plane
  47.       end_intersection
  48.       texture
  49.         0.05
  50.         ambient 0.3
  51.     diffuse 0.7
  52.     colour green 1.0
  53.       end_texture
  54.      end_object
  55.      object
  56.        intersection
  57.     quadric Cylinder_Y scale <0.5 1.0 0.5> end_quadric
  58.     plane <0.0 1.0 0.0> 32.0 end_plane
  59.     plane <0.0 1.0 0.0> 30.0 inverse end_plane
  60.       end_intersection
  61.       texture
  62.         0.05
  63.         ambient 0.3
  64.     diffuse 0.7
  65.     colour Tan
  66.       end_texture
  67.       end_object
  68.    end_composite
  69.  
  70. #declare
  71.   BluePencil = composite
  72.     object
  73.       intersection
  74.     quadric Cylinder_Y scale <0.5 1.0 0.5> end_quadric
  75.     plane <0.0 1.0 0.0> 30.0 end_plane
  76.     plane <0.0 1.0 0.0> 0.0 inverse end_plane
  77.       end_intersection
  78.       texture
  79.         0.05
  80.         ambient 0.3
  81.     diffuse 0.7
  82.     colour blue 1.0
  83.       end_texture
  84.      end_object
  85.      object
  86.        intersection
  87.     quadric Cylinder_Y scale <0.5 1.0 0.5> end_quadric
  88.     plane <0.0 1.0 0.0> 32.0 end_plane
  89.     plane <0.0 1.0 0.0> 30.0 inverse end_plane
  90.       end_intersection
  91.         texture
  92.            0.05
  93.        ambient 0.3
  94.        diffuse 0.7
  95.        colour Tan
  96.         end_texture
  97.       end_object
  98.    end_composite
  99.  
  100. view_point
  101.       location <0.0 40.0 -150.0>
  102.     up <0.0 1.0 0.0>
  103.     right <1.3333 0.0 0.0>
  104.     look_at <0.0 0.0 0.0>
  105. end_view_point
  106.  
  107. {The back wall}
  108.  
  109. object
  110.     plane <0.0 0.0 1.0> 200.0 end_plane
  111.     texture
  112.         0.1
  113.     ambient 0.3
  114.     diffuse 0.7
  115.     colour LightGray
  116.     end_texture
  117.     colour LightGray
  118. end_object
  119.  
  120. {The ceiling}
  121. object
  122.     plane <0.0 1.0 0.0> 500.0 end_plane
  123.     texture
  124.         0.1
  125.     ambient 0.3
  126.     diffuse 0.7
  127.     colour White
  128.     end_texture
  129. end_object
  130.  
  131.  
  132. {The desk surface}
  133.  
  134. object
  135.     intersection
  136.         plane <0.0 1.0 0.0> 2.0 end_plane
  137.     plane <0.0 1.0 0.0> -2.0 inverse end_plane
  138.     plane <0.0 0.0 1.0> 100.0 end_plane
  139.     plane <0.0 0.0 1.0> -100.0 inverse end_plane
  140.     plane <1.0 0.0 0.0> 125.0 end_plane
  141.     plane <1.0 0.0 0.0> -125.0 inverse end_plane
  142.     end_intersection
  143.     translate <0.0 -20.0 0.0>
  144.     texture
  145.     0.05
  146.     ambient 0.4
  147.     diffuse 0.6
  148.     Dark_Wood
  149.     scale <5.0 1.0 1.0>
  150.     reflection 0.2
  151.     brilliance 3.0
  152.     end_texture
  153. end_object
  154.  
  155. {Paperwork}
  156. object
  157.   union
  158.     triangle
  159.     <0.0 0.0 0.0>
  160.     <8.5 0.0 0.0>
  161.     <0.0 0.0 -11.0>
  162.     end_triangle
  163.     triangle
  164.     <0.0 0.0 -11.0>
  165.     <8.5 0.0 -11.0>
  166.     <8.5 0.0 0.0>
  167.     end_triangle
  168.    end_union
  169.    scale <3.0 1.0 3.0>
  170.    rotate <0.0 -30.0 0.0>
  171.    translate <-20.0 -17.9 -40.0>
  172.  
  173.    texture
  174.         0.05
  175.     ambient 0.1
  176.     diffuse 0.4
  177.     colour red 0.5 green 0.5 blue 0.3
  178.    end_texture
  179.    colour red 0.5 green 0.5 blue 0.3
  180. end_object
  181.  
  182. {a glass paperweight}
  183. object
  184.   intersection
  185.     sphere <0.0 -5.0 0.0> 10.0 end_sphere
  186.     plane <0.0 1.0 0.0> 0.0 inverse end_plane
  187.   end_intersection
  188.   translate <0.0 -17.8 -35.0>
  189.   texture
  190.     ambient 0.1
  191.     diffuse 0.6
  192.     colour red 0.3 green 0.5 blue 0.3 alpha 1.0
  193.     reflection 0.1
  194.     refraction 1.0
  195.     ior 1.5
  196.     brilliance 2.0
  197.    end_texture
  198. end_object
  199.  
  200. {The desk lamp}
  201.  
  202. composite
  203.   object
  204.      intersection
  205.       quadric Cylinder_Y scale <3.0 1.0 3.0> end_quadric
  206.       plane <0.0 1.0 0.0> 40.0 end_plane
  207.       plane <0.0 1.0 0.0> -18.0 inverse end_plane
  208.      end_intersection
  209.      texture
  210.     Shiny
  211.         0.05
  212.     ambient 0.2
  213.         diffuse 0.7
  214.         colour red 0.7 green 0.6 blue 0.1
  215.      end_texture
  216.   end_object
  217.  
  218.   object
  219.     intersection
  220.     quadric Cylinder_Y scale <25.0 1.0 25.0> end_quadric
  221.     plane <0.0 1.0 0.0> 2.0 end_plane
  222.     plane <0.0 1.0 0.0> -2.0 inverse end_plane
  223.     end_intersection
  224.     translate <0.0 -16.0 -5.0>
  225.     texture
  226.     0.05
  227.     ambient 0.3
  228.     diffuse 0.6
  229.     colour red 0.5 green 0.4 blue 0.1
  230.     reflection 0.4
  231.     brilliance 4.0
  232.     bumps 0.1
  233.     end_texture
  234.   end_object
  235.  
  236.   object
  237.    intersection
  238.      quadric Cylinder_X scale <1.0 10.0 10.0> end_quadric
  239.      quadric Cylinder_X scale <1.0 9.95 9.95> inverse end_quadric
  240.      plane <0.0 1.0 0.0> 0.0 inverse end_plane
  241.      plane <1.0 0.0 0.0> -30.0 inverse end_plane
  242.      plane <1.0 0.0 0.0> 30.0 end_plane
  243.    end_intersection
  244.     translate <0.0 35.0 -13.0>
  245.       texture
  246.     Shiny
  247.     0.05
  248.     ambient 0.5
  249.     diffuse 0.5
  250.     colour DarkGreen 
  251.     reflection 0.3
  252.     brilliance 4.0
  253.       end_texture
  254.    end_object
  255.  
  256.    object
  257.      union
  258.     intersection
  259.        sphere <-30.0 35.0 -13.0> 10.0 end_sphere
  260.        sphere <-30.0 35.0 -13.0> 9.95 inverse end_sphere
  261.        plane <0.0 1.0 0.0> 35.0 inverse end_plane
  262.        plane <1.0 0.0 0.0> -30.0 end_plane
  263.     end_intersection
  264.     intersection
  265.        plane <0.0 1.0 0.0> 35.0 inverse end_plane
  266.        plane <1.0 0.0 0.0> 30.0 inverse end_plane
  267.        sphere <30.0 35.0 -13.0> 10.0 end_sphere
  268.        sphere <30.0 35.0 -13.0> 9.95 inverse end_sphere
  269.     end_intersection
  270.       end_union
  271.       texture
  272.     Shiny
  273.     0.05
  274.        ambient 0.2
  275.     diffuse 0.7
  276.     colour red 0.7 green 0.6 blue 0.1
  277.     end_texture
  278.    end_object
  279.  
  280.  
  281.    rotate <0.0 35.0 0.0>
  282.    translate <50.0 0.0 30.0>
  283.     
  284. end_composite
  285.     
  286. {The fluorescent tube inside the lamp}
  287.  
  288. object
  289.    intersection
  290.     quadric Cylinder_X end_quadric
  291.     plane <1.0 0.0 0.0> -25.0 inverse end_plane
  292.     plane <1.0 0.0 0.0>  25.0 end_plane
  293.    end_intersection
  294.    translate <0.0 43.0 -10.0>
  295.    rotate <0.0 35.0 0.0>
  296.    translate <50.0 0.0 30.0>
  297.    texture
  298.     colour White
  299.     ambient 1.0
  300.     diffuse 0.0
  301.    end_texture
  302.    light_source
  303.    colour White
  304. end_object
  305.  
  306. {The Picture itself}
  307.  
  308. composite
  309.   object
  310.    intersection
  311.     plane <1.0 0.0 0.0> 1.0 end_plane
  312.     plane <1.0 0.0 0.0> -1.0 inverse end_plane
  313.     plane <0.0 1.0 0.0> 1.0 end_plane
  314.     plane <0.0 1.0 0.0> -1.0 inverse end_plane
  315.     plane <0.0 0.0 1.0> 1.0 end_plane
  316.     plane <0.0 0.0 1.0> -1.0 inverse end_plane
  317.    end_intersection
  318.    translate <1.0 1.0 1.0>
  319.    scale <20.0 15.0 1.0>
  320.    texture
  321.     ambient 0.05
  322.     diffuse 0.9
  323.     imagemap <1.0 -1.0 0.0> gif "rough.gif" once 
  324.         interpolate 2.0
  325.         end_map
  326.     scale <40.0 30.0 1.0>
  327.     scale <1.5 1.5 1.0>
  328.    end_texture
  329.   end_object
  330.  
  331. { The picture frame }
  332.   object
  333.     union
  334.      intersection
  335.     union
  336.       quadric Cylinder_Y scale <1.0 1.0 1.0> translate <41.0 0.0 0.0> end_quadric
  337.       quadric Cylinder_Y scale <1.0 1.0 1.0> translate <-1.0 0.0 0.0> end_quadric
  338.     end_union
  339.       plane <0.0 1.0 0.0> 31.0 end_plane
  340.           plane <0.0 1.0 0.0> -1.0 inverse end_plane
  341.      end_intersection
  342.      intersection
  343.     union
  344.         quadric Cylinder_X scale <1.0 1.0 1.0> translate <0.0 31.0 0.0> end_quadric
  345.       quadric Cylinder_X scale <1.0 1.0 1.0> translate <0.0 -1.0 0.0> end_quadric
  346.     end_union
  347.       plane <1.0 0.0 0.0> 41.0 end_plane
  348.       plane <1.0 0.0 0.0> -1.0 inverse end_plane
  349.      end_intersection
  350.       sphere <-1.0 -1.0 0.0> 1.0 end_sphere
  351.       sphere <-1.0 31.0 0.0> 1.0 end_sphere
  352.       sphere <41.0 -1.0 0.0> 1.0 end_sphere
  353.       sphere <41.0 31.0 0.0> 1.0 end_sphere
  354.     end_union
  355.     texture
  356.     0.05
  357.     Shiny
  358.     colour red 0.6 green 0.5 blue 0.1
  359.     ambient 0.3
  360.     diffuse 0.7
  361.     end_texture
  362.     colour red 0.6 green 0.5 blue 0.1
  363.   end_object
  364.  
  365.   scale <1.5 1.5 1.5>
  366.   rotate <10.0 -35.0 0.0>
  367.   translate <-65.0 -15.0 -25.0>
  368.  
  369. end_composite
  370.  
  371. {The pencil holder}
  372. composite
  373.   object
  374.     intersection
  375.     quadric Cylinder_Y scale <5.0 1.0 5.0> end_quadric
  376.     quadric Cylinder_Y scale <4.8 1.0 4.8> inverse end_quadric
  377.     plane <0.0 1.0 0.0> 0.0 inverse end_plane
  378.     plane <0.0 1.0 0.0> 15.0 rotate <-45.0 0.0 0.0> end_plane
  379.     end_intersection
  380.     texture
  381.     0.05
  382.     Shiny
  383.     ambient 0.3
  384.     diffuse 0.7
  385.         colour red 0.7 green 0.6 blue 0.1
  386.     reflection 0.4
  387.     brilliance 6.0
  388.     end_texture
  389.   end_object
  390.   composite RedPencil
  391.     rotate <0.0 0.0 -2.0>
  392.     translate <1.0 0.0 1.0>
  393.   end_composite
  394.   composite GreenPencil
  395.     rotate <0.0 0.0 2.0>
  396.     translate <-1.0 3.0 0.0>
  397.   end_composite
  398.   composite BluePencil
  399.     rotate <-2.0 0.0 3.0>
  400.     translate <0.0 -2.0 -1.0>
  401.   end_composite
  402.   bounded_by
  403.     intersection
  404.     quadric Cylinder_Y scale <6.0 1.0 6.0> end_quadric
  405.     plane <0.0 1.0 0.0> 36.0 end_plane
  406.     plane <0.0 1.0 0.0> -4.0 inverse end_plane
  407.     end_intersection
  408.   end_bound
  409.  
  410.   rotate <0.0 45.0 0.0>
  411.   translate <70.0 -18.0 -20.0>
  412.  
  413. end_composite
  414.  
  415. {The light source}
  416.  
  417. object
  418.     sphere <0.0 0.0 0.0> 20.0 end_sphere
  419.     translate <20.0 100.0 -200.0>
  420.     texture
  421.     colour White
  422.     ambient 0.3
  423.     diffuse 0.0
  424.     end_texture
  425.     light_source
  426.     colour White
  427. end_object
  428.