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

  1. // Persistence of Vision Raytracer
  2. // Sample file
  3. // By Aaron A. Collins
  4.  
  5. { Window Highlighting Scene by Aaron a. Collins }
  6. { This file is hereby released to the public domain. }
  7.  
  8. #include "shapes.dat"
  9. #include "colors.dat"
  10. #include "textures.dat"
  11.  
  12. { Someone to take in the breathtaking view... }
  13.  
  14. view_point
  15.    location <0.0  20.0  -100.0>
  16.    direction <0.0 0.0  1.0>
  17.    up  <0.0  1.0  0.0>
  18.    right <1.33333 0.0 0.0>
  19. end_view_point
  20.  
  21. { Put down the beloved famous raytrace green/yellow checkered floor }
  22.  
  23. object
  24.    plane <0.0 1.0 0.0> -10.0 end_plane
  25.    texture
  26.       checker colour Yellow colour CGreen
  27.       scale < 20.0 20.0 20.0 >
  28.       ambient 0.1
  29.       diffuse 0.9
  30.    end_texture
  31.    colour Yellow
  32. end_object
  33.  
  34. {
  35.  Now a CBlue Plastic sphere floating in space over the ground - note that no 
  36.  Phong or specular reflection is given.  Any would conflict with the window
  37.  "highlights" by showing that they are not exactly in the mirror direction!
  38. }
  39.  
  40. object
  41.    sphere <0.0 25.0 0.0> 40.0 end_sphere
  42.    texture
  43.       colour CBlue
  44.       reflection 0.8
  45.       ambient 0.3
  46.       diffuse 0.7
  47.    end_texture
  48.    colour CBlue
  49. end_object
  50.  
  51. {
  52.  a wall with a window frame to block the light source and cast the shadows
  53. }
  54.  
  55. object
  56.   union
  57.     triangle <-1000.0 -1000.0 0.0> <1000.0 4.0 0.0> <1000.0 -1000.0 0.0> end_triangle
  58.     triangle <-1000.0 -1000.0 0.0> <1000.0 4.0 0.0> <-1000.0 4.0 0.0> end_triangle
  59.     triangle <4.0 4.0 0.0> <-1000.0 21.0 0.0> <-1000.0 4.0 0.0> end_triangle
  60.     triangle <4.0 4.0 0.0> <-1000.0 21.0 0.0> <4.0 21.0 0.0> end_triangle
  61.     triangle <-1000.0 21.0 0.0> <1000.0 1000.0 0.0> <-1000.0 1000.0 0.0> end_triangle
  62.     triangle <-1000.0 21.0 0.0> <1000.0 1000.0 0.0> <1000.0 21.0 0.0> end_triangle
  63.     triangle <1000.0 4.0 0.0> <17.0 21.0 0.0> <1000.0 21.0 0.0> end_triangle
  64.     triangle <1000.0 4.0 0.0> <17.0 21.0 0.0> <17.0 4.0 0.0> end_triangle
  65.     triangle <4.0 12.0 0.0> <17.0 13.0 0.0> <4.0 13.0 0.0> end_triangle
  66.     triangle <4.0 12.0 0.0> <17.0 13.0 0.0> <17.0 12.0 0.0> end_triangle
  67.     triangle <10.0 21.0 0.0> <11.0 4.0 0.0> <11.0 21.0 0.0> end_triangle
  68.     triangle <10.0 21.0 0.0> <11.0 4.0 0.0> <10.0 4.0 0.0> end_triangle
  69.   end_union
  70.   translate <39.0 89.0 -120.0>
  71.   texture
  72.     colour Black
  73.     ambient 1.0
  74.     diffuse 0.0
  75.   end_texture
  76. end_object
  77.  
  78. {
  79.   Now, the 4 actual "panes" to be reflected back onto the sphere for psuedo-
  80.   "highlights".  They are not exactly co-incident with where the actual light
  81.   source is, because they would block the light.  They are very near by where
  82.   the openings are in the black wall above, close enough to give the proper
  83.   illusion.  This is massive cheating, but then, this isn't reality, you see.
  84. }
  85.  
  86. object
  87.   union
  88.     triangle <4.0 21.0 0.0> <10.0 13.0 0.0> <10.0 21.0 0.0> end_triangle
  89.     triangle <4.0 21.0 0.0> <10.0 13.0 0.0> <4.0 13.0 0.0> end_triangle
  90.  
  91.     triangle <11.0 21.0 0.0> <17.0 13.0 0.0> <11.0 13.0 0.0> end_triangle
  92.     triangle <11.0 21.0 0.0> <17.0 13.0 0.0> <17.0 21.0 0.0> end_triangle
  93.  
  94.     triangle <4.0 12.0 0.0> <10.0 4.0 0.0> <4.0 4.0 0.0> end_triangle
  95.     triangle <4.0 12.0 0.0> <10.0 4.0 0.0> <10.0 12.0 0.0> end_triangle
  96.  
  97.     triangle <11.0 12.0 0.0> <17.0 4.0 0.0> <11.0 4.0 0.0> end_triangle
  98.     triangle <11.0 12.0 0.0> <17.0 4.0 0.0> <17.0 12.0 0.0> end_triangle
  99.   end_union
  100.   scale <15.0 15.0 15.0>
  101.   translate <20.0 90.0 -100.0>
  102.   texture
  103.     colour White
  104.     ambient 1.0
  105.     diffuse 0.0
  106.   end_texture
  107. end_object
  108.  
  109.  
  110. { a Light above the sphere, behind the camera and window frame for shadows }
  111.  
  112. object
  113.    sphere <0.0 0.0 0.0> 0.001 end_sphere
  114.    translate <50.0 111.0 -130.0>
  115.    texture
  116.      colour White
  117.      ambient 1.0
  118.      diffuse 0.0
  119.    end_texture
  120.    light_source
  121.    colour White
  122. end_object
  123.