home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / DKBOS2.ZOO / dkb212dt.zoo / window.dat < prev    next >
Text File  |  1991-04-12  |  4KB  |  119 lines

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