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

  1. // Persistence of Vision Raytracer
  2. // Sample file
  3. // By Dan Farmer
  4. //    Minneapolis, mn
  5.  
  6. // Demonstrates one use of the powerful alpha parameter for colors.
  7.  
  8. #include "shapes.dat"
  9. #include "colors.dat"
  10. #include "textures.dat"
  11.  
  12. view_point
  13.     location <-1.5  30.0  -150.0>
  14.     direction <0.0 0.0 2.0>
  15.     up  <0.0  1.0  0.0>
  16.     right <1.33333 0.0 0.0>
  17.     look_at <0.0  25.0  35.0>
  18. end_view_point
  19.  
  20. object    { Basic Light source }
  21.     sphere <0.0 0.0 0.0> 5.0 end_sphere
  22.     translate <100.0  100.0  -200.0>
  23.     texture
  24.        colour White
  25.        ambient 1.0
  26.        diffuse 0.0
  27.     end_texture
  28.     light_source
  29.     colour White
  30. end_object
  31.  
  32. { Now draw the sky }
  33. object
  34.     sphere <0.0  0.0  0.0> 200000.0 end_sphere
  35.     texture
  36.         0.05
  37.         marble
  38.         turbulence 1.0
  39.         colour_map
  40.             [0.0 0.5   colour red 0.5 green 0.6 blue 1.0
  41.                        colour red 0.6 green 0.5 blue 1.0]
  42.             [0.5 0.6   colour red 0.5 green 0.6 blue 1.0
  43.                        colour red 1.0 green 1.0 blue 1.0]
  44.             [0.6 1.001 colour red 1.0 green 1.0 blue 1.0
  45.                        colour red 0.5 green 0.5 blue 0.5]
  46.         end_colour_map
  47.         scale <10.0 10.0 10.0>
  48.         ambient 1.0
  49.         diffuse 0.0
  50.     end_texture
  51.     colour SkyBlue
  52. end_object
  53.  
  54. {*****************************************************************************}
  55. {
  56.   This composite makes a checkerboard with alternating marblized and solid
  57.   checks.
  58.    Ideas:
  59.     1) Sub-plane could also be a smaller-scaled checker pattern.
  60.     2) Also, what if sub-plane was a solid color plane, but farther below
  61.        the upper plane, say y= -2.0 ?
  62.    So many ideas, so little time.  Anybody got a 486 to spare?
  63. }
  64. composite
  65.  
  66.     { Marbled checkerboard pattern using alpha 1.0 }
  67.     object
  68.         plane <0.0 1.0 0.0 > 0.0 end_plane      { Checkerboard surface plane }
  69.         texture
  70.             checker colour Thistle colour White alpha 1.0
  71.             scale <10.0 10.0 10.0>
  72.         end_texture
  73.         color White alpha 1.0
  74.     end_object
  75.  
  76.     { Marble sub-plane. }
  77.     object
  78.         plane <0.0 1.0 0.0 > -0.1 end_plane
  79.         texture
  80.         White_Marble
  81.         scale <10.0 10.0 10.0>
  82.         end_texture
  83.         color White
  84.     end_object
  85. end_composite
  86.  
  87.  
  88. {*****************************************************************************}
  89. {
  90.   This next composite uses the alpha parameter to make a sphere with
  91.   a "cutout" checker pattern.  a smaller, reflective sphere inside
  92.   is just there to add interest.
  93.  
  94.   Again, don't limit this to checker patterns.  Try it with gradient and
  95.   bozo, for example. Or maybe marble with alpha 1.0 for all but the
  96.   "veins".
  97.   Try a series of "nested" concentric spheres, all with the transparent
  98.   checker pattern as its surface, perhaps in different colors.
  99. }
  100.  
  101. composite
  102.     object    { QSphere with transparent checker sections }
  103.         sphere <0.0 25.0 0.0 > 25.0 end_sphere
  104.         texture
  105.             checker colour YellowGreen colour White  alpha 1.0
  106.             scale <2.0 500.0 1.0>
  107.             rotate <90 0.0 -90.0>
  108.         end_texture
  109.         color White alpha 1.0
  110.     end_object
  111.  
  112.     bounded_by
  113.         sphere <0.0 25.0 0.0> 25.2 end_sphere
  114.     end_bound
  115. end_composite
  116.