home *** CD-ROM | disk | FTP | other *** search
- // Persistence of Vision Raytracer
- // Sample file
- // By Drew Wells
-
- // Title-"Tomb"
-
- // -+ Compuserve Hall Of Fame award winner +-
-
- // A haunted tomb on a hill, gravestones, rusty fence, pumpkin patch.
- // - Drew Wells CIS 73767,1244
- // 11/29/90
-
- #include "shapes.dat"
- #include "colors.dat"
- #include "textures.dat"
-
-
- { Camera }
- view_point
- direction <0.0 0.0 1.5>
- up <0.0 1.0 0.0>
- right <-1.333 0.0 0.0>
- translate < -15.0 5.0 120.0>
- look_at <10.0 12.0 55.0>
- end_view_point
-
- #declare Yellow_Clouds = texture
- 0.05
- bozo
- turbulence 0.6
- colour_map
- [0.0 0.5 colour red 0.9 green 0.5 blue 0.3
- colour red 0.4 green 0.4 blue 0.0]
- [0.5 0.6 colour red 1.0 green 1.0 blue 1.0 alpha 1.0
- colour red 1.0 green 1.0 blue 1.0 alpha 1.0 ]
- [0.6 1.001 colour red 1.0 green 1.0 blue 1.0 alpha 1.0
- colour red 1.0 green 1.0 blue 1.0 alpha 1.0]
- end_colour_map
- end_texture
-
- #declare Sunset_Sky = texture
- 0.05
- gradient <0.0 1.0 0.0>
-
- colour_map
- [0.0 0.4 {blue}
- colour red 0.8 green 0.0 blue 0.0
- colour red 0.4 green 0.0 blue 0.4]
-
- [0.4 0.6 colour red 0.4 green 0.0 blue 0.4
- {white}
- colour red 0.0 green 0.0 blue 0.2]
- [0.6 1.001 colour red 0.0 green 0.0 blue 0.2
- {grey}
- colour red 0.0 green 0.0 blue 0.0]
- end_colour_map
- scale <700.0 700.0 700.0>
- end_texture
- // Somewhere along the line I lost my original moss texture.
- // This version looks interesting, but...
- #declare Moss = texture
- marble
- turbulence 0.62
- colour_map
- [0.0 0.5 colour red 0.7 green 0.7 blue 0.45
- colour red 0.7 green 0.65 blue 0.35]
- [0.5 0.55 colour red 0.55 green 0.7 blue 0.45
- colour red 0.45 green 0.60 blue 0.35]
- [0.55 0.6 colour red 0.0 green 0.50 blue 0.20
- colour red 0.5 green 0.6 blue 0.35]
- [0.6 0.7 colour red 0.5 green 0.6 blue 0.35
- colour red 0.05 green 0.35 blue 0.05]
- [0.7 0.8 colour red 0.05 green 0.35 blue 0.05
- colour red 0.20 green 0.30 blue 0.0]
- [0.8 0.9 colour red 0.20 green 0.30 blue 0.0
- colour red 0.20 green 0.50 blue 0.0]
- [0.9 1.001 colour red 0.20 green 0.50 blue 0.00
- colour red 0.20 green 0.30 blue 0.0]
- end_colour_map
- scale <1.7 1.7 1.7>
- end_texture
-
-
- {***********************************************}
- { Define objects for use in scene }
- {***********************************************}
-
- #declare Cross =
- object
- union
- { Tried to make celtic cross, but vga resolution is too coarse }
- { intersection
- quadric Cylinder_Z
- scale <0.4 0.4 0.4>
- translate <0.0 0.45 0.0>
- end_quadric
- plane <0.0 0.0 -1.0> 0.02 end_plane
- plane <0.0 0.0 1.0> 0.02 end_plane
- end_intersection }
-
- {vertical part}
- intersection
- {top & bottom}
- plane <0.0 1.0 0.0> 1.0 end_plane
- plane <0.0 -1.0 0.0> 2.0 end_plane
- {front & back}
- plane <0.0 0.0 1.0> 0.12 end_plane
- plane <0.0 0.0 -1.0> 0.12 end_plane
- {left & right}
- plane <1.0 0.0 0.0> 0.15 end_plane
- plane <-1.0 0.0 0.0> 0.15 end_plane
- end_intersection
-
- {horizontal part}
- intersection
- {top & bottom}
- plane <0.0 1.0 0.0> 0.6 end_plane
- plane <0.0 -1.0 0.0> -0.3 end_plane
- {front & back}
- plane <0.0 0.0 1.0> 0.12 end_plane
- plane <0.0 0.0 -1.0> 0.12 end_plane
- {left & right walls}
- plane <1.0 0.0 0.0> 0.7 end_plane
- plane <-1.0 0.0 0.0> 0.7 end_plane
- end_intersection
- end_union
- bounded_by
- intersection
- plane <0.0 1.0 0.0> 1.1 end_plane
- plane <0.0 -1.0 0.0> 2.1 end_plane
- plane <0.0 0.0 1.0> 0.2 end_plane
- plane <0.0 0.0 -1.0> 0.2 end_plane
- plane <1.0 0.0 0.0> 0.8 end_plane
- plane <-1.0 0.0 0.0> 0.8 end_plane
- end_intersection
- end_bound
- texture
- granite
- scale <0.1 0.1 0.1>
- ambient 0.1
- diffuse 0.9
- end_texture
- colour CBlue
- end_object
-
- #declare Headstone =
- object
- union
- intersection
- quadric Cylinder_Z end_quadric
- plane <0.0 0.0 -1.0> 0.1 end_plane
- plane <0.0 0.0 1.0> 0.1 end_plane
- end_intersection
- intersection
- {top & bottom}
- plane <0.0 1.0 0.0> 0.0 end_plane
- plane <0.0 -1.0 0.0> 2.0 end_plane
- {front & back}
- plane <0.0 0.0 1.0> 0.1 end_plane
- plane <0.0 0.0 -1.0> 0.1 end_plane
- {left & right }
- plane <1.0 0.0 0.0> 1.0 end_plane
- plane <-1.0 0.0 0.0> 1.0 end_plane
- end_intersection
- end_union
- texture
- granite
- scale<0.1 0.2 0.1>
- ambient 0.1
- diffuse 0.9
- end_texture
- colour CBlue
- end_object
-
- #declare Beam = quadric Cylinder_Y
- scale <1.0 1.0 1.0>
- end_quadric
-
- #declare Beam2 = quadric Cylinder_Y
- inverse
- scale <0.5 1.0 0.5>
- translate <1.4 0.0 0.0>
- end_quadric
-
- #declare Beam3 =
- object
- intersection
- quadric Beam scale <1.2 1.0 1.2> end_quadric
- quadric Beam2 end_quadric
- quadric Beam2 rotate <0.0 -45.0 0.0> end_quadric
- quadric Beam2 rotate <0.0 -90.0 0.0> end_quadric
- quadric Beam2 rotate <0.0 -135.0 0.0> end_quadric
- quadric Beam2 rotate <0.0 180.0 0.0> end_quadric
- quadric Beam2 rotate <0.0 45.0 0.0> end_quadric
- quadric Beam2 rotate <0.0 90.0 0.0> end_quadric
- quadric Beam2 rotate <0.0 135.0 0.0> end_quadric
- plane <0.0 1.0 0.0> 8.0 end_plane
- plane <0.0 -1.0 0.0> 0.0 end_plane
- end_intersection
- { CBlue marble was modified to look like green moss/mold }
- texture
- Moss
- ambient 0.1
- diffuse 0.99
- end_texture
- colour red 0.8 green 0.0 blue 0.0
- end_object
-
- #declare Pole = quadric Cylinder_Y
- scale <0.1 1.0 0.1>
- end_quadric
-
-
- #declare Xpole = quadric Cylinder_X
- scale <0.1 0.1 0.1>
- end_quadric
-
- { Rusty iron gate & fence - object should have been composite to avoid the }
- { "carved from one piece" look. }
- #declare Gate = object
- union
- intersection
- quadric Xpole end_quadric
- plane <1.0 0.0 0.0> 8.0 end_plane
- plane <-1.0 0.0 0.0> 2.0 end_plane
- translate <0.0 6.5 0.0>
- end_intersection
- intersection
- quadric Xpole end_quadric
- plane <1.0 0.0 0.0> 8.0 end_plane
- plane <-1.0 0.0 0.0> 2.0 end_plane
- translate <0.0 1.9 0.0>
- end_intersection
- intersection
- quadric Pole end_quadric
- plane <0.0 1.0 0.0> 7.5 end_plane
- plane <0.0 -1.0 0.0> 0.0 end_plane
- translate <1.0 0.0 0.2>
- end_intersection
- sphere <1.0 7.5 0.0> 0.3 end_sphere
- intersection
- quadric Pole end_quadric
- plane <0.0 1.0 0.0> 7.75 end_plane
- plane <0.0 -1.0 0.0> 0.2 end_plane
- translate <2.5 0.0 0.0>
- end_intersection
- sphere <2.5 7.75 0.0> 0.3 end_sphere
- intersection
- quadric Pole end_quadric
- plane <0.0 1.0 0.0> 8.0 end_plane
- plane <0.0 -1.0 0.0> 0.2 end_plane
- translate <4.0 0.0 0.0>
- end_intersection
- sphere <4.0 8.0 0.0> 0.3 end_sphere
- intersection
- quadric Pole end_quadric
- plane <0.0 1.0 0.0> 7.75 end_plane
- plane <0.0 -1.0 0.0> 0.2 end_plane
- translate<5.5 0.0 0.0>
- end_intersection
- sphere <5.5 7.75 0.0> 0.3 end_sphere
- intersection
- quadric Pole end_quadric
- plane <0.0 1.0 0.0> 7.5 end_plane
- plane <0.0 -1.0 0.0> 0.2 end_plane
- translate <7.0 0.0 0.0>
- end_intersection
- sphere <7.0 7.5 0.0> 0.3 end_sphere
- end_union
- bounded_by
- intersection
- plane <0.0 1.0 0.0> 9.0 end_plane
- plane <0.0 -1.0 0.0> 0.0 end_plane
- plane <0.0 0.0 1.0> 1.0 end_plane
- plane <0.0 0.0 -1.0> 1.0 end_plane
- plane <1.0 0.0 0.0> 8.0 end_plane
- plane <-1.0 0.0 0.0> 0.0 end_plane
- end_intersection
- end_bound
- texture
- 0.05
- Rust
- ambient 0.4
- diffuse 0.99
- end_texture
- colour CBlue
- end_object
-
- { a rectangular pad to serve as a footing for the column }
- #declare BasePad =
- object
- intersection
- plane <0.0 1.0 0.0> 0.25 end_plane
- plane <0.0 -1.0 0.0> 0.25 end_plane
- plane <0.0 0.0 1.0> 1.2 end_plane
- plane <0.0 0.0 -1.0> 1.2 end_plane
- plane <1.0 0.0 0.0> 1.2 end_plane
- plane <-1.0 0.0 0.0> 1.2 end_plane
- end_intersection
-
- texture
- Moss
- scale <0.8 0.3 1.0>
- ambient 0.1
- diffuse 0.9
- end_texture
- colour red 0.6 green 0.6 blue 0.4
- end_object
-
- #declare Column = composite
- object Beam3 translate <0.0 0.0 0.0> end_object
- object BasePad translate <0.0 1.0 0.0> end_object
- object BasePad translate <0.0 8.0 0.0> end_object
- end_composite
-
- #declare Tomb = object
- union
- { Main structure }
- intersection
- {ceiling and floor}
- plane <0.0 1.0 0.0> 10.0 end_plane
- plane <0.0 -1.0 0.0> 6.0 end_plane
- {front and back walls}
- plane <0.0 0.0 1.0> 7.5 end_plane
- plane <0.0 0.0 -1.0> 7.5 end_plane
- {left & right walls}
- plane <1.0 0.0 0.0> 10.0 end_plane
- plane <-1.0 0.0 0.0> 10.0 end_plane
- {doorway}
- intersection
- {ceiling and floor}
- plane <0.0 1.0 0.0> 7.0 end_plane
- plane <0.0 -1.0 0.0> 6.0 end_plane
- {front and back walls}
- plane <0.0 0.0 1.0> 17.5 end_plane
- plane <0.0 0.0 -1.0> 7.0 end_plane
- {left & right walls}
- plane <1.0 0.0 0.0> 3.0 end_plane
- plane <-1.0 0.0 0.0> 3.0 end_plane
- inverse
- end_intersection
- end_intersection
- { Foundation }
- intersection
- {top & bottom}
- plane <0.0 1.0 0.0> -1.0 end_plane
- plane <0.0 -1.0 0.0> 5.0 end_plane
- {front & back}
- plane <0.0 0.0 1.0> 8.5 end_plane
- plane <0.0 0.0 -1.0> 8.5 end_plane
- {left & right}
- plane <1.0 0.0 0.0> 11.0 end_plane
- plane <-1.0 0.0 0.0> 11.0 end_plane
- end_intersection
- end_union
- bounded_by
- sphere <0.0 0.0 0.0> 18.0 end_sphere
- end_bound
- texture
- granite
- bumps 0.8
- scale < 0.5 0.1 1.0>
- ambient 0.1
- diffuse 0.9
- end_texture
- colour CBlue
- end_object
-
- #declare InnerBeams = object
- union
- intersection
- quadric Beam end_quadric
- plane <0.0 1.0 0.0> 8.0 end_plane
- plane <0.0 -1.0 0.0> 2.0 end_plane
- translate < 5.0 0.0 7.5>
- end_intersection
- intersection
- quadric Beam end_quadric
- plane <0.0 1.0 0.0> 8.0 end_plane
- plane <0.0 -1.0 0.0> 2.0 end_plane
- translate < -5.0 0.0 7.5>
- end_intersection
- end_union
- texture
- granite
- bumps 0.5
- scale < 0.5 0.6 1.0>
- ambient 0.10
- diffuse 0.9
- end_texture
- colour CBlue
- end_object
-
- #declare Pointy = object
- union
- {pointy part}
- intersection
- plane <0.0 -1.0 0.0> 1.0 end_plane
- plane <0.0 0.0 1.0> 0.5 end_plane
- plane <0.0 0.0 -1.0> 0.5 end_plane
- plane <1.0 0.0 0.0> 0.0 rotate <0.0 0.0 70.0> end_plane
- plane <-1.0 0.0 0.0> 0.0 rotate <0.0 0.0 -70.0> end_plane
- scale <3.0 4.0 1.0>
- translate < 0.0 12.0 7.5>
- end_intersection
- end_union
- texture
- granite
- bumps 0.5
- scale < 0.7 0.5 0.33>
- ambient 0.10
- diffuse 0.9
- end_texture
- colour CBlue
- end_object
-
- #declare CornerBeams = object
- union
- intersection
- quadric Beam scale <1.5 1.0 1.5>end_quadric
- plane <0.0 1.0 0.0> 10.0 end_plane
- plane <0.0 -1.0 0.0> 2.0 end_plane
- translate < 10.0 0.0 7.5>
- end_intersection
- intersection
- quadric Beam scale <1.5 1.0 1.5> end_quadric
- plane <0.0 1.0 0.0> 10.0 end_plane
- plane <0.0 -1.0 0.0> 2.0 end_plane
- translate < -10.0 0.0 7.5>
- end_intersection
- sphere < -10.0 10.0 7.5> 1.5 end_sphere
- sphere < 10.0 10.0 7.5> 1.5 end_sphere
- end_union
- texture
- granite
- bumps 0.5
- scale < 0.3 0.1 1.0>
- ambient 0.10
- diffuse 0.9
- end_texture
- colour CBlue
- end_object
-
- { Ghost in tomb doorway }
- #declare Figure = object
- intersection
- quadric Beam scale <2.3 1.0 2.3> end_quadric
- plane <0.0 1.0 0.0> 8.0 end_plane
- plane <0.0 -1.0 0.0> 2.0 end_plane
- translate < 0.0 0.0 4.3>
- end_intersection
- texture
- granite
- { Use any ghost image you like for the tomb doorway or comment }
- { out the Figure in TombAll }
- {imagemap <-1.0 1.0 0.0> gif "ghost.gif" once
- interpolate 2.0
- end_map}
- scale < 6.5 8.0 6.5 >
- translate < -1.0 7.5 4.3 >
- ambient 0.10
- diffuse 0.3
- end_texture
- colour Black
- end_object
-
- { TombAll is the completed tomb }
- #declare TombAll = composite
- object Tomb end_object
- object InnerBeams end_object
- object Pointy end_object
- object CornerBeams end_object
- object Figure end_object
- end_composite
-
- { Pumpkin parts }
- #declare Stem = object
- intersection
- quadric Pole end_quadric
- plane <0.0 1.0 0.0> 0.04 rotate <0.0 -10.0 -10.0> end_plane
- plane <0.0 -1.0 0.0> 1.0 end_plane
- translate<0.0 0.3 0.0>
- end_intersection
- texture
- bumps 0.5
- color red 0.04 green 0.33 blue 0.05
- scale < 0.2 0.2 0.2>
- ambient 0.1
- diffuse 0.9
- end_texture
- color red 0.04 green 0.33 blue 0.05
- end_object
-
- #declare Slice = quadric
- QSphere
- translate <0.0 0.0 0.5>
- scale <0.28 0.30 0.40>
- end_quadric
-
- #declare Pumpkin = object
- union
- quadric Slice end_quadric
- quadric Slice rotate <0.0 -20.0 0.0> end_quadric
- quadric Slice rotate <0.0 -40.0 0.0> end_quadric
- quadric Slice rotate <0.0 -60.0 0.0> end_quadric
- quadric Slice rotate <0.0 -80.0 0.0> end_quadric
- quadric Slice rotate <0.0 -100.0 0.0> end_quadric
- quadric Slice rotate <0.0 -120.0 0.0> end_quadric
- quadric Slice rotate <0.0 -140.0 0.0> end_quadric
- quadric Slice rotate <0.0 -160.0 0.0> end_quadric
- quadric Slice rotate <0.0 -180.0 0.0> end_quadric
- quadric Slice rotate <0.0 -200.0 0.0> end_quadric
- quadric Slice rotate <0.0 -220.0 0.0> end_quadric
- quadric Slice rotate <0.0 -240.0 0.0> end_quadric
- quadric Slice rotate <0.0 -260.0 0.0> end_quadric
- quadric Slice rotate <0.0 -280.0 0.0> end_quadric
- quadric Slice rotate <0.0 -300.0 0.0> end_quadric
- quadric Slice rotate <0.0 -320.0 0.0> end_quadric
- quadric Slice rotate <0.0 -340.0 0.0> end_quadric
- end_union
- bounded_by
- quadric QSphere scale <1.5 1.5 1.5> end_quadric
- end_bound
- texture
- bumps 0.3
- color red 0.5 green 0.22 blue 0.1
- scale < 0.1 0.1 0.1>
- ambient 0.1
- diffuse 0.9
- phong 0.75
- phongsize 30.0
- end_texture
- color red 0.5 green 0.22 blue 0.1
- end_object
-
-
- {*****************************************}
- { Scene description }
- {*****************************************}
-
- object
- Cross
- scale <1.7 2.0 1.0>
- rotate <-15.0 0.0 0.0>
- translate <-16.0 7.7 61.5>
- end_object
-
- object
- Headstone
- scale <1.0 1.0 1.0>
- rotate <15.0 0.0 0.0>
- translate <-14.0 4.0 76.0>
- end_object
-
- object
- Headstone
- scale <1.0 1.0 1.0>
- translate <12.0 4.0 74.0>
- end_object
-
- object
- Headstone
- scale <1.0 1.0 1.0>
- rotate <-10.0 0.0 0.0>
- translate <18.0 8.0 70.0>
- end_object
-
- object
- Cross
- scale <1.5 2.0 1.0>
- rotate <-15.0 0.0 0.0>
- translate <17.0 10.0 60.0>
- end_object
-
- object
- Cross
- scale <1.5 2.0 1.0>
- rotate <-15.0 0.0 20.0>
- translate <26.0 10.0 70.0>
- end_object
-
- object
- Cross
- scale <1.5 2.0 1.0>
- rotate <-15.0 0.0 -10.0>
- translate <31.0 10.0 78.0>
- end_object
-
-
- { Little Pumpkin Patch }
- object
- Pumpkin
- scale <1.5 2.0 1.5>
- translate < 5.0 1.55 95.0>
- end_object
- object
- Stem
- scale <1.5 2.5 1.5>
- translate < 5.0 1.55 95.0>
- end_object
- object
- Pumpkin
- scale <1.5 2.5 1.5>
- translate < 11.0 1.6 90.0>
- end_object
- object
- Stem
- scale <1.5 2.5 1.5>
- translate < 11.0 1.6 90.0>
- end_object
-
-
- { Ghastly Tomb!}
- composite
- TombAll
- rotate <15.0 15.0 0.0>
- translate <0.0 10.0 58.0>
- end_composite
-
- {left entry gate}
- object
- Gate
- translate <-9.0 0.0 88.0>
- end_object
-
- {right entry gate}
- object
- Gate
- rotate <-10.0 -160.0 0.0>
- translate <7.0 0.0 87.5>
- end_object
-
- {Use gate object to make left & right fence}
- object
- Gate
- translate <-19.0 0.0 88.0>
- end_object
- object
- Gate
- translate <-31.0 0.0 88.0>
- end_object
- object
- Gate
- translate <9.0 0.0 88.0>
- end_object
- object
- Gate
- translate <19.0 0.0 88.0>
- end_object
-
- { Columns to hold the fence and gates up }
- composite Column translate <-20.0 0.0 88.0> end_composite
- composite Column translate <-10.0 0.0 88.0> end_composite
- composite Column translate < 8.0 0.0 88.0> end_composite
- composite Column translate < 18.0 0.0 88.0> end_composite
-
- {hill under tomb}
- object
- quadric Paraboloid_Y
- scale<40.0 10.0 77.0>
- end_quadric
- rotate <0.0 0.0 180.0>
- translate <0.0 21.0 -28.0>
- texture
- bumps 0.8
- color red 0.5 green 0.6 blue 0.2
- scale < 5.0 5.0 5.0>
- ambient 0.1
- diffuse 0.7
- end_texture
- color red 0.5 green 0.6 blue 0.2
- end_object
-
- {hill to right of tomb}
- object
- quadric Paraboloid_Y
- scale<30.0 10.0 40.0>
- end_quadric
- rotate <0.0 0.0 180.0>
- translate <40.0 14.0 50.0>
- texture
- bumps 0.8
- color red 0.6 green 0.6 blue 0.1
- scale < 7.0 5.0 5.0>
- ambient 0.1
- diffuse 0.7
- end_texture
- color red 0.6 green 0.6 blue 0.1
- end_object
-
- { Ground }
- object
- plane <0.0 1.0 0.0> 1.0 end_plane
- texture
- bumps 0.7
- color red 0.6 green 0.6 blue 0.1
- scale < 1.0 1.0 1.0>
- ambient 0.1
- diffuse 0.7
- end_texture
- color red 0.6 green 0.6 blue 0.1
- end_object
-
- {The Sun}
- object
- sphere <0.0 0.0 0.0> 150.0 end_sphere
- translate <150.0 30.0 1200.0>
- texture
- color White
- ambient 1.0
- diffuse 0.0
- end_texture
- light_source
- color White
- end_object
-
- { Sky - gradient sunset}
- object
- sphere <0.0 0.0 0.0> 2000.0 inverse end_sphere
- texture
- Sunset_Sky
- translate <0.0 200.0 0.0>
- scale <1.2 1.2 1.2>
- ambient 0.6
- diffuse 0.0
- end_texture
- color CGreen
- end_object
-
- { Clouds - uses a sky texture with the sky portion defined as transparent }
- { so the gradient behind it is visible }
- object
- sphere <0.0 0.0 0.0> 1997.0 inverse end_sphere
- texture
- Yellow_Clouds
- scale <1000.0 30.0 100.0>
- ambient 0.6
- diffuse 0.0
- end_texture
- color CGreen
- end_object
-