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

  1. // Persistence of Vision Raytracer
  2. // Sample file
  3. // By Dan Farmer
  4. { Script for a lawn with a swimming pool.
  5.   Written by Dan Farmer.  Takes quite a while to render because of
  6.   the many textures and waveforms used.  An interesting variation of this
  7.   theme would be to change the view to look into the garden globe and see
  8.   the rest of the scene as the reflection in the globe.
  9.  
  10.   As stated below, most of the garden globe structure was taken from the
  11.   file "roman.dat" that was included with pvdat.
  12. }
  13.  
  14. #include "colors.dat"
  15. #include "shapes.dat"
  16. #include "textures.dat"
  17.  
  18. #declare Cube = intersection  { this is a good one to add to basicsha.dat }
  19.         plane <0.0 0.0 1.0> 1.0 end_plane
  20.         plane <0.0 0.0 -1.0> 1.0 end_plane
  21.         plane <0.0 1.0 0.0> 1.0 end_plane
  22.         plane <0.0 -1.0 0.0> 1.0 end_plane
  23.         plane <1.0 0.0 0.0> 1.0 end_plane
  24.         plane <-1.0 0.0 0.0> 1.0 end_plane
  25.         scale <1.0 1.0 1.0>
  26. end_intersection
  27.  
  28. { Most of the garden globe is borrowed from "roman.dat"}
  29. {******************************************************}
  30.     #declare Beam = quadric Cylinder_Y
  31.         scale <0.5 20.0 0.5>
  32.         translate <2.0 0.0 0.0>
  33.     end_quadric
  34.  
  35.     { create a sample column for the base of the structure }
  36.     #declare BaseColumn = object
  37.        intersection
  38.           union
  39.              quadric Beam end_quadric
  40.              quadric Beam rotate <0.0 -25.7  0.0> end_quadric
  41.              quadric Beam rotate <0.0 -51.4  0.0> end_quadric
  42.              quadric Beam rotate <0.0 -77.1  0.0> end_quadric
  43.              quadric Beam rotate <0.0 -102.8 0.0> end_quadric
  44.              quadric Beam rotate <0.0 -128.5 0.0> end_quadric
  45.              quadric Beam rotate <0.0 -154.2 0.0> end_quadric
  46.              quadric Beam rotate <0.0 -179.9 0.0> end_quadric
  47.              quadric Beam rotate <0.0 -205.6 0.0> end_quadric
  48.              quadric Beam rotate <0.0 -231.3 0.0> end_quadric
  49.              quadric Beam rotate <0.0 -257.0 0.0> end_quadric
  50.              quadric Beam rotate <0.0 -282.7 0.0> end_quadric
  51.              quadric Beam rotate <0.0 -308.4 0.0> end_quadric
  52.              quadric Beam rotate <0.0 -334.1 0.0> end_quadric
  53.          end_union
  54.          plane <0.0 1.0 0.0> 20.0 end_plane
  55.          plane <0.0 -1.0 0.0> 0.0 end_plane
  56.        end_intersection
  57.        bounded_by
  58.          intersection
  59.             plane <0.0 1.0 0.0> 20.0 end_plane
  60.             plane <0.0 -1.0 0.0> 0.0 end_plane
  61.              quadric
  62.                 Cylinder_Y
  63.                 scale <2.51 1.0 2.51>
  64.              end_quadric
  65.          end_intersection
  66.        end_bound
  67.        texture
  68.          White_Marble
  69.      scale <10.0 10.0 10.0>
  70.          ambient 0.4
  71.          diffuse 0.9
  72.          reflection 0.1
  73.        end_texture
  74.        colour red 0.8 green 0.0 blue 0.0
  75.     end_object
  76.  
  77.     { and a rectangular pad to serve as a footing for the column }
  78.     #declare BasePad = object
  79.        intersection Cube
  80.            scale <4.0 1.0 4.0>
  81.        end_intersection
  82.        bounded_by
  83.           quadric
  84.              QSphere
  85.              scale <10.0 3.0 10.0>
  86.           end_quadric
  87.        end_bound
  88.        texture
  89.          White_Marble
  90.      scale <10.0 10.0 10.0>
  91.          ambient 0.4
  92.          diffuse 0.9
  93.          reflection 0.1
  94.        end_texture
  95.        colour red 0.6 green 0.6 blue 0.4
  96.     end_object
  97.  
  98.     #declare Globe = object
  99.         sphere <0.0 0.0 0.0> 5.0 end_sphere
  100.         texture
  101.           Mirror
  102.       color CBlue
  103.         end_texture
  104.     color CBlue
  105.     end_object
  106.  
  107.     #declare Garden_Globe = composite
  108.        object BaseColumn translate <0.0 0.0 0.0>   end_object
  109.        object BasePad    translate <0.0 -1.0 0.0>  end_object
  110.        object BasePad    translate <0.0 21.0 0.0>  end_object
  111.        object Globe      translate<0.0 26.0 0.0> end_object
  112.     end_composite
  113. {******************** End of Garden Globe Epic ******************************}
  114.  
  115. { Everybody's gotta have a point of view. }
  116. view_point
  117.    location <0.0  30.0  -120.0>
  118.    direction <0.0 0.0  1.0>
  119.    up  <0.0  1.0  0.0>
  120.    right <1.33333 0.0 0.0>
  121.    look_at <0.0 0.0 0.0>
  122. end_view_point
  123.  
  124. { No, fool... i said _bud_ light! }
  125. object  
  126.    sphere <0.0  0.0  0.0>  2.0 end_sphere
  127.    translate <100.0  200.0  -200.0>
  128.    texture
  129.      colour White
  130.      ambient 1.0
  131.      diffuse 0.0
  132.    end_texture
  133.    light_source
  134.    colour White
  135. end_object
  136.  
  137. { "The sky was the color of her eyes" }
  138. {             ... and just as cloudy! }
  139. object
  140.   sphere <0.0 -10000.0 -200.0> 15000.0 end_sphere
  141.   texture
  142.       0.05
  143.       Bright_Blue_Sky
  144.       scale <7500.0 1000.0 5000.0>
  145.       ambient 0.7
  146.       diffuse 0.0
  147.   end_texture
  148.   colour red 0.5 green 0.5 blue 1.0
  149. end_object
  150.  
  151. { Plant a little grass, well mowed. }
  152. object
  153.     plane <0.0 1.0 0.0> 0.0 end_plane
  154.     texture
  155.         0.05  { This value dithers the colours }
  156.     color CGreen
  157.         ripples 0.5
  158.         frequency 2000.0
  159.         scale <50000.0 50000.0 50000.0>
  160.     end_texture
  161.     color CGreen
  162. end_object
  163.  
  164. { Now, we pour the concrete and set the tiles...}
  165. object
  166.     difference
  167.         intersection Cube
  168.             scale <45.0 10.0 60.0>
  169.         end_intersection
  170.         intersection Cube { Inside box }
  171.             scale <35.0 11.0 50.0>
  172.         end_intersection
  173.     end_difference
  174.     translate <0.0 -8.0 0.0 >
  175.     texture
  176.         checker colour DarkTurquoise colour White
  177.         scale <2.0 2.0 2.0>
  178.     end_texture
  179.     color DarkTurquoise
  180. end_object
  181.  
  182.  { Better put some water in the pool! }
  183. object
  184.     intersection Cube
  185.         scale <35.0 10.0 50.0>
  186.         translate<0.0 -9.0 0.0>
  187.     end_intersection
  188.     texture
  189.         0.05
  190.     color LightBlue               {alpha 0.5 ?}
  191.         ripples 0.5
  192.         frequency 100.0
  193.         scale <5.0 5.0 10.0>
  194.         translate <20.0 4.0 -15.0>    { Where the ball floats?? }
  195.     reflection 0.5
  196.     brilliance 3.0
  197. {??     refraction 1.0        { Doesn't really help the scene any... }
  198.         ior 1.2 ?? }
  199.     end_texture
  200.     color LightBlue
  201. end_object
  202.  
  203. { Let's add a diving board }
  204. object
  205.     union
  206.         intersection Cube                        { The board itself }
  207.             scale <6.0 1.0 30.0 >
  208.             translate <0.0 2.0 -30.0>
  209.         end_intersection
  210.         intersection Cube                        { a block under the board }
  211.             scale <6.0 2.0 2.0 >
  212.             translate <0.0 1.0 -30.0>
  213.         end_intersection
  214.     end_union
  215.     texture
  216.         Cherry_Wood
  217.     0.05
  218.     scale <0.02 0.02 0.02>
  219.     end_texture
  220.     color Brown
  221. end_object
  222.  
  223. { Float a red and white striped ball in the pool }
  224. object
  225.     sphere <0.0 0.0 0.0> 5.0 end_sphere
  226.     translate <20.0 4.0 -15.0>    { Sorta right front center of pool }
  227.     texture
  228.        gradient < 1.0 1.0 0.0 >
  229.        colour_map
  230.             [0.00 0.25  colour White colour White ]
  231.             [0.25 0.75  colour red 1.0  colour red 1.0]
  232.             [0.75 1.001 colour White colour White ]
  233.        end_colour_map
  234.        scale <7.0 7.0 7.0>
  235.        rotate <-30.0 30.0 0.0>
  236.        ambient 0.3
  237.        diffuse 0.7
  238.        phong 0.5
  239.        phongsize 10.0
  240.     end_texture
  241.     color CRed
  242. end_object
  243.  
  244. { Place the garden globe on left side of pool }
  245. composite Garden_Globe translate <-60.0 0.0 0.0> end_composite
  246.  
  247. { The hedge behind the pool }
  248. object
  249. intersection Cube end_intersection
  250.     scale <200.0 30.0 30.0>
  251.     translate <-100.0 0.0 180.0>
  252.     texture
  253.         0.05  { This value dithers the colours }
  254.     color YellowGreen
  255.         turbulence 0.5
  256.         spotted 0.5
  257.         colour_map
  258.              [0.00 0.25  colour YellowGreen colour CGreen ]
  259.              [0.25 0.75  colour CGreen colour DarkGreen]
  260.              [0.75 1.001 colour DarkGreen colour YellowGreen ]
  261.         end_colour_map
  262.         wrinkles 1.0
  263.         frequency 2000.0
  264.         scale <10.0 10.0 20.0>
  265.     end_texture
  266.     color YellowGreen
  267. end_object
  268.  
  269. { The hedge on the right side of pool }
  270. object
  271. intersection Cube end_intersection
  272.     scale <30.0 30.0 100.0>
  273.     translate <100.0 0.0 -85.0>
  274.     texture
  275.         0.05  { This value dithers the colours }
  276.     color YellowGreen
  277.         turbulence 0.5
  278.         spotted 0.5
  279.         colour_map
  280.              [0.00 0.25  colour YellowGreen colour CGreen ]
  281.              [0.25 0.75  colour CGreen colour DarkGreen]
  282.              [0.75 1.001 colour DarkGreen colour YellowGreen ]
  283.     end_colour_map
  284.         wrinkles 1.0
  285.         frequency 2000.0
  286.         scale <10.0 10.0 20.0>
  287.     end_texture
  288.     color YellowGreen
  289. end_object
  290.  
  291. { a low, squat shrub of some generic species }
  292. object
  293. quadric QSphere end_quadric
  294.     scale <30.0 20.0 25.0>
  295.     translate <-70.0 0.0 110.0>
  296.     texture
  297.         0.05  { This value dithers the colours }
  298.     color YellowGreen
  299.         turbulence 0.5
  300.         spotted 1.0
  301.         colour_map
  302.              [0.00 0.25  colour Khaki colour CGreen ]
  303.              [0.25 0.50  colour CGreen colour DarkGreen]
  304.              [0.50 0.75  colour DarkGreen colour MediumForestGreen]
  305.              [0.75 1.001 colour MediumForestGreen colour YellowGreen ]
  306.         end_colour_map
  307.         wrinkles 1.0
  308.         frequency 2000.0
  309.         scale <5.0 5.0 5.0>
  310.     end_texture
  311.     color YellowGreen
  312. end_object
  313.