home *** CD-ROM | disk | FTP | other *** search
- // Persistence of Vision Raytracer
- // Sample file
- // By Tom Price
-
- #include "shapes.dat"
- #include "colors.dat"
- #include "textures.dat"
-
- view_point
- location <0.0 50.0 -150.0>
- up <0.0 1.0 0.0>
- right <1.3333 0.0 0.0>
- look_at <0.0 0.0 0.0>
- end_view_point
-
-
- object
- sphere <0.0 0.0 0.0> 20.0 end_sphere
- translate <50.0 150.0 -250.0>
- texture
- colour White
- ambient 1.0
- diffuse 0.0
- end_texture
- light_source
- colour White
- end_object
-
- object
- sphere <0.0 0.0 0.0> 20.0 end_sphere
- translate <-50.0 150.0 -250.0>
- texture
- colour White
- ambient 1.0
- diffuse 0.0
- end_texture
- light_source
- colour White
- end_object
-
-
- {The Sky}
- object
- sphere <0.0 -49000.0 -200.0> 50000.0 inverse end_sphere
- texture
- Bright_Blue_Sky
- 0.05
- scale <5000.0 1000.0 5000.0>
- ambient 0.7
- diffuse 0.0
- end_texture
- colour SkyBlue
- end_object
-
- { The wood grain tabletop }
- object
- intersection
- plane <1.0 0.0 0.0> 1.0 end_plane
- plane <1.0 0.0 0.0> -1.0 inverse end_plane
- plane <0.0 1.0 0.0> 1.0 end_plane
- plane <0.0 1.0 0.0> -1.0 inverse end_plane
- plane <0.0 0.0 1.0> 1.0 end_plane
- plane <0.0 0.0 1.0> -1.0 inverse end_plane
- end_intersection
- texture
- Pine_Wood
- scale <7.0 1.0 0.7>
- rotate <0.0 -30.0 0.0>
- ambient 0.1
- diffuse 0.5
- reflection 0.3
- brilliance 3.0
- end_texture
- bounded_by
- intersection
- plane <1.0 0.0 0.0> 1.01 end_plane
- plane <1.0 0.0 0.0> -1.01 inverse end_plane
- plane <0.0 1.0 0.0> 1.01 end_plane
- plane <0.0 1.0 0.0> -1.01 inverse end_plane
- plane <0.0 0.0 1.0> 1.01 end_plane
- plane <0.0 0.0 1.0> -1.01 inverse end_plane
- end_intersection
- end_bound
- scale <200.0 1.0 200.0>
- translate <0.0 -42.0 0.0>
- end_object
-
-
- { a salami }
- #declare
- Salami = composite
- { the outside skin }
- object
- union
- intersection
- quadric Cylinder_X scale <1.0 20.0 20.0> end_quadric
- plane <1.0 0.0 0.0> 10.0 end_plane
- plane <1.0 0.0 0.0> -10.0 inverse end_plane
- end_intersection
- sphere <-10.0 0.0 0.0> 20.0 end_sphere
- end_union
- texture
- 0.05
- colour red 0.5 green 0.2 blue 0.2
- ambient 0.1
- diffuse 0.8
- reflection 0.2
- brilliance 3.0
- phong 0.3
- phongsize 20.0
- end_texture
- colour red 0.5 green 0.2 blue 0.2
- end_object
- object
- intersection
- quadric Cylinder_X scale <1.0 19.0 19.0> end_quadric
- plane <1.0 0.0 0.0> 10.01 end_plane
- plane <1.0 0.0 0.0> -10.0 inverse end_plane
- end_intersection
- texture
- 0.1
- colour Pink
- ambient 0.3
- diffuse 0.7
- end_texture
- colour Pink
- end_object
- bounded_by
- intersection
- quadric Cylinder_X scale <1.0 20.01 20.01> end_quadric
- plane <1.0 0.0 0.0> 10.02 end_plane
- plane <1.0 0.0 0.0> -30.01 inverse end_plane
- end_intersection
- end_bound
- end_composite
-
- { a salami slice }
- #declare
- Slice = composite
- { the outside skin }
- object
- intersection
- quadric Cylinder_X scale <1.0 20.0 20.0> end_quadric
- plane <1.0 0.0 0.0> 0.5 end_plane
- plane <1.0 0.0 0.0> -0.5 inverse end_plane
- end_intersection
- texture
- 0.05
- colour red 0.5 green 0.2 blue 0.2
- ambient 0.1
- diffuse 0.8
- reflection 0.2
- brilliance 3.0
- phong 0.3
- phongsize 20.0
- end_texture
- colour red 0.5 green 0.2 blue 0.2
- end_object
- object
- intersection
- quadric Cylinder_X scale <1.0 19.0 19.0> end_quadric
- plane <1.0 0.0 0.0> 0.51 end_plane
- plane <1.0 0.0 0.0> -0.51 inverse end_plane
- end_intersection
- texture
- 0.1
- ambient 0.3
- diffuse 0.7
- colour Pink
- end_texture
- colour Pink
- end_object
- bounded_by
- intersection
- quadric Cylinder_X scale <1.0 20.01 20.01> end_quadric
- plane <1.0 0.0 0.0> 0.52 end_plane
- plane <1.0 0.0 0.0> -0.52 inverse end_plane
- end_intersection
- end_bound
- end_composite
-
-
- { a wedge of cheese}
- #declare
- Cheese = object
- intersection
- quadric Cylinder_Y scale <10.0 1.0 10.0> end_quadric
- plane <0.0 1.0 0.0> 20.0 end_plane
- plane <0.0 1.0 0.0> 0.0 inverse end_plane
- plane <1.0 0.0 0.0> 5.0 rotate <0.0 30.0 0.0> end_plane
- plane <1.0 0.0 0.0> -5.0 rotate <0.0 -30.0 0.0> inverse end_plane
- quadric Cylinder_X scale <1.0 1.0 1.5>
- rotate <0.0 -20.0 30>
- translate <0.0 10.0 0.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 2.0 1.5>
- rotate <0.0 20.0 -30>
- translate <0.0 12.0 -4.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 1.0 1.0>
- translate <0.0 15.0 -9.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 2.0 1.5>
- rotate <0.0 -30.0 -30.0>
- translate <0.0 15.0 5.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 1.5 1.5>
- rotate <0.0 0.0 -20.0>
- translate <0.0 7.0 -9.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 1.0 1.0>
- rotate <0.0 10.0 10.0>
- translate <0.0 10.0 -2.0>
- inverse end_quadric
- quadric Cylinder_X scale <1.0 1.0 1.2>
- rotate <0.0 -10.0 0.0>
- translate <0.0 5.0 0.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 1.3 1.0>
- translate <0.0 3.0 -3.0>
- inverse
- end_quadric
- end_intersection
- texture
- 0.05
- colour red 1.0 green 0.8 blue 0.0
- ambient 0.2
- diffuse 0.8
- end_texture
- colour red 1.0 green 0.8 blue 0.0
- bounded_by
- intersection
- quadric Cylinder_Y scale <10.01 1.0 10.01> end_quadric
- plane <0.0 1.0 0.0> 20.01 end_plane
- plane <0.0 1.0 0.0> -0.01 inverse end_plane
- end_intersection
- end_bound
- end_object
-
- { a slice of cheese}
- #declare
- CheeseSlice = object
- intersection
- quadric Cylinder_Y scale <10.0 1.0 10.0> end_quadric
- plane <0.0 1.0 0.0> 20.0 end_plane
- plane <0.0 1.0 0.0> 0.0 inverse end_plane
- plane <1.0 0.0 0.0> 0.2 end_plane
- plane <1.0 0.0 0.0> -0.2 inverse end_plane
- quadric Cylinder_X scale <1.0 1.0 1.5>
- rotate <0.0 -20.0 30>
- translate <0.0 10.0 0.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 2.0 1.5>
- rotate <0.0 20.0 -30>
- translate <0.0 12.0 -4.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 1.0 1.0>
- translate <0.0 15.0 -9.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 2.0 1.5>
- rotate <0.0 -30.0 -30.0>
- translate <0.0 15.0 5.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 1.5 1.5>
- rotate <0.0 0.0 -20.0>
- translate <0.0 7.0 -9.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 1.0 1.0>
- rotate <0.0 10.0 10.0>
- translate <0.0 10.0 -2.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 1.0 1.2>
- rotate <0.0 -10.0 0.0>
- translate <0.0 3.0 5.0>
- inverse
- end_quadric
- quadric Cylinder_X scale <1.0 1.3 1.0>
- rotate <0.0 0.0 0.0>
- translate <0.0 2.0 2.0>
- inverse
- end_quadric
- end_intersection
- texture
- 0.05
- colour red 1.0 green 0.8 blue 0.0
- ambient 0.2
- diffuse 0.8
- end_texture
- colour red 1.0 green 0.8 blue 0.0
- bounded_by
- intersection
- quadric Cylinder_Y scale <10.01 1.0 10.01> end_quadric
- plane <0.0 1.0 0.0> 20.01 end_plane
- plane <0.0 1.0 0.0> -0.01 inverse end_plane
- plane <1.0 0.0 0.0> 0.3 end_plane
- plane <1.0 0.0 0.0> -0.3 inverse end_plane
- end_intersection
- end_bound
- end_object
-
- { An oval glass dish }
- #declare
- Dish = object
- union
- intersection
- quadric QSphere scale <100.0 25.0 25.0> end_quadric
- quadric QSphere scale <95.0 24.0 24.0> inverse end_quadric
- plane <0.0 1.0 0.0> 0.0 end_plane
- plane <0.0 1.0 0.0> -5.0 inverse end_plane
- end_intersection
- intersection
- quadric Cylinder_Y scale <95.0 1.0 24.0> end_quadric
- plane <0.0 1.0 0.0> -4.0 end_plane
- plane <0.0 1.0 0.0> -5.0 inverse end_plane
- end_intersection
- end_union
- texture
- colour Clear
- ambient 0.1
- diffuse 0.8
- refraction 0.95
- ior 1.5
- reflection 0.05
- brilliance 2.0
- end_texture
- colour Clear
- bounded_by
- intersection
- quadric Cylinder_Y scale <100.01 1.0 25.01> end_quadric
- plane <0.0 1.0 0.0> 0.01 end_plane
- plane <0.0 1.0 0.0> -5.01 inverse end_plane
- end_intersection
- end_bound
- end_object
-
- { a slice of bread }
- #declare
- BreadSlice = composite
- object
- union
- intersection
- plane <1.0 0.0 0.0> 10.0 end_plane
- plane <1.0 0.0 0.0> -10.0 inverse end_plane
- plane <0.0 1.0 0.0> 1.0 end_plane
- plane <0.0 1.0 0.0> -1.0 inverse end_plane
- plane <0.0 0.0 1.0> 10.0 end_plane
- plane <0.0 0.0 1.0> -10.0 inverse end_plane
- end_intersection
- intersection
- quadric Cylinder_Y scale <11.0 1.0 7.0>
- translate <0.0 0.0 10.0>
- end_quadric
- plane <0.0 1.0 0.0> 1.0 end_plane
- plane <0.0 1.0 0.0> -1.0 inverse end_plane
- end_intersection
- end_union
- texture
- 0.05
- colour red 0.4 green 0.3 blue 0.1
- ambient 0.3
- diffuse 0.7
- reflection 0.1
- brilliance 2.0
- end_texture
- colour red 0.4 green 0.3 blue 0.1
- end_object
-
- object
- union
- intersection
- plane <1.0 0.0 0.0> 9.5 end_plane
- plane <1.0 0.0 0.0> -9.5 inverse end_plane
- plane <0.0 1.0 0.0> 1.01 end_plane
- plane <0.0 1.0 0.0> -1.01 inverse end_plane
- plane <0.0 0.0 1.0> 9.5 end_plane
- plane <0.0 0.0 1.0> -9.5 inverse end_plane
- end_intersection
- intersection
- quadric Cylinder_Y scale <10.5 1.0 6.5>
- translate <0.0 0.0 10.0>
- end_quadric
- plane <0.0 1.0 0.0> 1.01 end_plane
- plane <0.0 1.0 0.0> -1.01 inverse end_plane
- end_intersection
- end_union
- texture
- 0.1
- colour red 0.7 green 0.6 blue 0.45
- ambient 0.3
- diffuse 0.7
- end_texture
- colour red 0.7 green 0.6 blue 0.45
- end_object
- bounded_by
- intersection
- plane <1.0 0.0 0.0> 10.1 end_plane
- plane <1.0 0.0 0.0> -10.1 inverse end_plane
- plane <0.0 1.0 0.0> 1.0 end_plane
- plane <0.0 1.0 0.0> -1.1 inverse end_plane
- plane <0.0 0.0 1.0> 17.1 end_plane
- plane <0.0 0.0 1.0> -10.1 inverse end_plane
- end_intersection
- end_bound
- end_composite
-
- { Now to put the scene together}
- composite
- object Dish
- scale <0.7 1.0 1.2>
- translate <0.0 -36.0 -25.0>
- end_object
-
- composite Salami
- rotate <0.0 35.0 0.0>
- translate <-30.0 -20.0 -20.0>
- end_composite
-
- object Cheese
- scale <2.0 2.0 2.0>
- rotate <0.0 25.0 0.0>
- translate <30.0 -40.0 -25.0>
- end_object
- translate <0.0 0.0 25.0>
- rotate <0.0 -15.0 0.0>
- translate <-35.0 0.0 20.0>
- end_composite
-
- { now a sandwich }
- composite
- composite Slice
- rotate <0.0 90.0 0.0>
- rotate <90.0 0.0 0.0>
- translate <45.0 -33.0 -35.0>
- end_composite
-
- object CheeseSlice
- scale <1.0 2.0 2.0>
- rotate <0.0 -90.0 0.0>
- rotate <90.0 0.0 0.0>
- translate <0.0 0.0 -16.0>
- rotate <0.0 30.0 0.0>
- translate <45.0 -35.0 -35.0>
- end_object
-
- composite BreadSlice
- scale <1.6 2.0 1.0>
- rotate <0.0 -150.0 0.0>
- translate <45.0 -38.0 -35.0>
- end_composite
-
- composite BreadSlice
- scale <1.6 2.0 1.0>
- rotate <0.0 -150.0 0.0>
- translate <45.0 -29.0 -35.0>
- end_composite
- translate <0.0 15.0 10.0>
- end_composite
-
- {spotlight on the sandwich}
- object
- intersection
- quadric Cylinder_Y scale <7.5 1.0 7.5> end_quadric
- quadric Cylinder_Y scale <7.4 1.0 7.4> inverse end_quadric
- plane <0.0 1.0 0.0> 50.0 end_plane
- plane <0.0 1.0 0.0> 0.0 inverse end_plane
- end_intersection
- translate <45.0 100.0 -25.0>
- texture
- colour White
- ambient 0.3
- diffuse 0.7
- end_texture
- colour White
- end_object
-
- object
- sphere <0.0 0.0 0.0> 4.0 end_sphere
- translate <45.0 145.0 -25.0>
- texture
- colour White
- ambient 1.0
- diffuse 0.0
- end_texture
- light_source
- colour White
- end_object
-
- composite Slice
- rotate <0.0 90.0 0.0>
- rotate <65.0 0.0 0.0>
- translate <-30.0 25.0 45.0>
- end_composite
-
- composite Slice
- rotate <0.0 90.0 0.0>
- rotate <60.0 0.0 0.0>
- translate <35.0 25.0 25.0>
- end_composite
-
- object CheeseSlice
- scale <1.0 2.0 2.0>
- rotate <0.0 -90.0 0.0>
- rotate <50.0 0.0 0.0>
- translate <-20.0 35.0 30.0>
- end_object
-
- object CheeseSlice
- scale <1.0 2.0 2.0>
- rotate <0.0 -90.0 0.0>
- rotate <70.0 0.0 0.0>
- translate <65.0 15.0 35.0>
- end_object
-
- composite BreadSlice
- scale <1.6 2.0 1.0>
- rotate <-40.0 -60.0 0.0>
- translate <-60.0 25.0 35.0>
- end_composite
-
- composite BreadSlice
- scale <1.6 2.0 1.0>
- rotate <60.0 50.0 0.0>
- translate <70.0 0.0 30.0>
- end_composite
-