home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / raytrace / rayce27 / csg3.r < prev    next >
Encoding:
Text File  |  1993-11-25  |  909 b   |  47 lines

  1. // Test CSG, part 3
  2. // 
  3.  
  4. camera {
  5.   location <4, 4, -4>
  6.   fov 90
  7.   look_at <0, 0, 0>
  8. }
  9.  
  10. options { background y color rgb <0.2, 0.2, 0.2> }
  11.  
  12. #declare WeirdGreen = texture {        /* any suggestions for a better name? */
  13.   diffuse color red 0.8 blue 0.8 ambient color green 0.2  
  14. }
  15.  
  16. #declare Disk_X = intersection {
  17.   quadric { <0, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1 }
  18.   plane { <1, 0, 0>, 1 }
  19.   plane { <-1, 0, 0>, 1 }
  20. }
  21.  
  22. #declare difficult = intersection {
  23.   union {
  24.     intersection { Disk_X scale <2, 2, 2> }
  25.     box { <2, 2, 4>, <-2, -2, 0> }     
  26.   }
  27.   intersection {
  28.     plane { <1, 0, 0>, 0.5 rotate <0, -45, 0> }
  29.     plane { <-1, 0, 0>, 0.5 rotate <0, 45, 0> }
  30.     inverse
  31.     translate <0, 0, -0.75>      // translate test
  32.   }
  33. }
  34.  
  35.  
  36. #declare csg5 = composite {
  37.   object {
  38.     intersection { difficult }
  39.     texture { WeirdGreen }
  40.   }
  41.   object { light_source { <-4, 4, -4> color red 1.0 } }
  42. }
  43.  
  44. composite { csg5 }
  45.  
  46.  
  47.