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

  1. // more CSG
  2.  
  3. camera {
  4.   location <0, 0, 3.0>
  5.   fov 120
  6.   look_at <0, 0, 0>
  7. }
  8.  
  9. options { background y color rgb <0.2, 0.2, 0.2> }
  10.  
  11. #declare WeirdGreen = texture {        /* any suggestions for a better name? */
  12.   diffuse color red 0.8 blue 0.8 ambient color green 0.2  
  13. }
  14.  
  15. #declare Disk_X = intersection {
  16.   quadric { <0, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1 }
  17.   plane { <1, 0, 0>, 1 }
  18.   plane { <-1, 0, 0>, 1 }
  19. }
  20.  
  21. #declare difficult = intersection {
  22.     union {
  23.       box { <2, 2, 4>, <-2, -2, 0> }
  24.       intersection { Disk_X scale < 2, 2, 2> }
  25.       
  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. #declare identicaltwin = union {
  36.     intersection {
  37.       box { <2, 2, 4>, <-2, -2, 0> inverse }
  38.       intersection { Disk_X scale <2, 2, 2> inverse }
  39.       inverse
  40.     }
  41.     union {
  42.       plane { <1, 0, 0>, 0.5 rotate <0, -45, 0> inverse }
  43.       plane { <-1, 0, 0>, 0.5 rotate <0, 45, 0> inverse }
  44.       translate <0, 0, -0.75>      // translate test      
  45.     }
  46.     inverse
  47. }
  48.  
  49. #declare csg7 = composite {
  50.   object {
  51.     union { identicaltwin }
  52.     // intersection { difficult }
  53.     texture { WeirdGreen }
  54.   }
  55.   object { light_source { <0.5, -1.5, 1.5> color red 1.0 } }
  56. }
  57.  
  58. composite { csg7 }
  59.  
  60.  
  61.  
  62.