home *** CD-ROM | disk | FTP | other *** search
- // test csg
-
- camera{
- location <4, 3, -5>
- fov 90
- look_at <0, 0, 0>
- }
-
- options { background y color rgb <0.2, 0.2, 0.2> }
-
- #declare WeirdGreen =texture { /* any suggestions for a better name? */
- diffuse color red 0.8 blue 0.8 ambient color green 0.2
- }
-
- #declare csg1 = composite {
- object { /* ok */
- intersection {
- sphere { <0, 0, 0>, 4 }
- plane { <1, 0, 0>, 0 }
- plane { <0, 0, -1>, 0 }
- }
- texture { WeirdGreen }
- }
- object { light_source { <-2, 0, -2> color red 1.0 } }
- object { light_source { <1, 0, 0> color blue 1.0} }
- }
-
- #declare csg1a = composite {
- /* the same, now with quadric */
- intersection { /* this works OK too */
- quadric { <1, 1, 1>, <0, 0, 0>, <0, 0, 0>, -16 }
- plane { <1, 0, 0>, 0 }
- plane { <0, 0, -1>, 0.01 }
- texture { WeirdGreen }
- }
- object { light_source { <-2, 0, -2> color red 1.0 } }
- }
-
- #declare Cilinder_Z = quadric { <1, 1, 0>, <0, 0, 0>, <0, 0, 0>, -1 }
-
- #declare csg2 = composite {
- intersection {
- plane { <0, 0, -1>, 0 }
- quadric { Cilinder_Z }
- texture { WeirdGreen }
- }
- object { light_source { <5, 3, -1> color red 1.0 } }
- }
-
- #declare CSGBox = intersection { /* test declares */
- plane { <0, 1, 0>, 1 }
- plane { <0, -1, 0>, 1 }
- plane { <0, 0, 1>, 1 }
- plane { <0, 0, -1>, 1 }
- plane { <1, 0, 0>, 1 }
- plane { <-1, 0, 0>, 1 }
- scale <2, 2, 2> /* test scaling */
- }
-
- #declare csg3 = composite{ /* OK!*/
- intersection { CSGBox texture { WeirdGreen } }
- light_source { <-4, 4, -4> color red 1.0 }
- light_source { <4, 1, 1> color blue 1.0 }
- }
-
- #declare csg6 = composite {
- union {
- sphere { <0, 0, 0>, 3 }
- sphere { <0, 0, 3>, 3 }
- texture { WeirdGreen }
- }
- object { light_source { <8, 2, 2> color blue 1.0 } }
- }
-
-