home *** CD-ROM | disk | FTP | other *** search
- // Persistence of Vision Raytracer
- // Sample file
- // By Aaron A. Collins
-
- { Window Highlighting Scene by Aaron a. Collins }
- { This file is hereby released to the public domain. }
-
- #include "shapes.dat"
- #include "colors.dat"
- #include "textures.dat"
-
- { Someone to take in the breathtaking view... }
-
- view_point
- location <0.0 20.0 -100.0>
- direction <0.0 0.0 1.0>
- up <0.0 1.0 0.0>
- right <1.33333 0.0 0.0>
- end_view_point
-
- { Put down the beloved famous raytrace green/yellow checkered floor }
-
- object
- plane <0.0 1.0 0.0> -10.0 end_plane
- texture
- checker colour Yellow colour CGreen
- scale < 20.0 20.0 20.0 >
- ambient 0.1
- diffuse 0.9
- end_texture
- colour Yellow
- end_object
-
- {
- Now a CBlue Plastic sphere floating in space over the ground - note that no
- Phong or specular reflection is given. Any would conflict with the window
- "highlights" by showing that they are not exactly in the mirror direction!
- }
-
- object
- sphere <0.0 25.0 0.0> 40.0 end_sphere
- texture
- colour CBlue
- reflection 0.8
- ambient 0.3
- diffuse 0.7
- end_texture
- colour CBlue
- end_object
-
- {
- a wall with a window frame to block the light source and cast the shadows
- }
-
- object
- union
- triangle <-1000.0 -1000.0 0.0> <1000.0 4.0 0.0> <1000.0 -1000.0 0.0> end_triangle
- triangle <-1000.0 -1000.0 0.0> <1000.0 4.0 0.0> <-1000.0 4.0 0.0> end_triangle
- triangle <4.0 4.0 0.0> <-1000.0 21.0 0.0> <-1000.0 4.0 0.0> end_triangle
- triangle <4.0 4.0 0.0> <-1000.0 21.0 0.0> <4.0 21.0 0.0> end_triangle
- triangle <-1000.0 21.0 0.0> <1000.0 1000.0 0.0> <-1000.0 1000.0 0.0> end_triangle
- triangle <-1000.0 21.0 0.0> <1000.0 1000.0 0.0> <1000.0 21.0 0.0> end_triangle
- triangle <1000.0 4.0 0.0> <17.0 21.0 0.0> <1000.0 21.0 0.0> end_triangle
- triangle <1000.0 4.0 0.0> <17.0 21.0 0.0> <17.0 4.0 0.0> end_triangle
- triangle <4.0 12.0 0.0> <17.0 13.0 0.0> <4.0 13.0 0.0> end_triangle
- triangle <4.0 12.0 0.0> <17.0 13.0 0.0> <17.0 12.0 0.0> end_triangle
- triangle <10.0 21.0 0.0> <11.0 4.0 0.0> <11.0 21.0 0.0> end_triangle
- triangle <10.0 21.0 0.0> <11.0 4.0 0.0> <10.0 4.0 0.0> end_triangle
- end_union
- translate <39.0 89.0 -120.0>
- texture
- colour Black
- ambient 1.0
- diffuse 0.0
- end_texture
- end_object
-
- {
- Now, the 4 actual "panes" to be reflected back onto the sphere for psuedo-
- "highlights". They are not exactly co-incident with where the actual light
- source is, because they would block the light. They are very near by where
- the openings are in the black wall above, close enough to give the proper
- illusion. This is massive cheating, but then, this isn't reality, you see.
- }
-
- object
- union
- triangle <4.0 21.0 0.0> <10.0 13.0 0.0> <10.0 21.0 0.0> end_triangle
- triangle <4.0 21.0 0.0> <10.0 13.0 0.0> <4.0 13.0 0.0> end_triangle
-
- triangle <11.0 21.0 0.0> <17.0 13.0 0.0> <11.0 13.0 0.0> end_triangle
- triangle <11.0 21.0 0.0> <17.0 13.0 0.0> <17.0 21.0 0.0> end_triangle
-
- triangle <4.0 12.0 0.0> <10.0 4.0 0.0> <4.0 4.0 0.0> end_triangle
- triangle <4.0 12.0 0.0> <10.0 4.0 0.0> <10.0 12.0 0.0> end_triangle
-
- triangle <11.0 12.0 0.0> <17.0 4.0 0.0> <11.0 4.0 0.0> end_triangle
- triangle <11.0 12.0 0.0> <17.0 4.0 0.0> <17.0 12.0 0.0> end_triangle
- end_union
- scale <15.0 15.0 15.0>
- translate <20.0 90.0 -100.0>
- texture
- colour White
- ambient 1.0
- diffuse 0.0
- end_texture
- end_object
-
-
- { a Light above the sphere, behind the camera and window frame for shadows }
-
- object
- sphere <0.0 0.0 0.0> 0.001 end_sphere
- translate <50.0 111.0 -130.0>
- texture
- colour White
- ambient 1.0
- diffuse 0.0
- end_texture
- light_source
- colour White
- end_object
-