//Dan Crowdus' truncation program #include "colors.inc" #include "stones.inc" #include "glass.inc" #include "metals.inc" #include "woods.inc" camera { location <2,1.5,-4.5> look_at <0,0,0> } light_source { <50, 50, -100> colour Gray70} light_source { <2,2.5,-3> color White*2.5 } background { color MidnightBlue } plane { y, -1 pigment { color Blue scale 20 } finish { ambient 0.2 diffuse 0.8 } } #declare s = clock #declare l = sqrt( 3 - (2 * s) + ((1/3) * (s * s))) #declare myCube = box { <-1, -1, -1>, // Near lower left corner < 1, 1, 1> // Far upper right corner } #declare p1 = plane {<1,1,1>,l} #declare p2 = plane {<1,1,-1>,l} #declare p3 = plane {<1,-1,1>,l} #declare p4 = plane {<1,-1,-1>,l} #declare p5 = plane {<-1,1,1>,l} #declare p6 = plane {<-1,1,-1>,l} #declare p7 = plane {<-1,-1,1>,l} #declare p8 = plane {<-1,-1,-1>,l} #declare t1 = polygon{4,<1-s,1,1>,<1,1-s,1>,<1,1,1-s>,<1-s,1,1>} #declare t2 = polygon{4,<1-s,1,-1>,<1,1-s,-1>,<1,1,-1+s>,<1-s,1,-1>} #declare t3 = polygon{4,<1-s,-1,1>,<1,-1+s,1>,<1,-1,1-s>,<1-s,-1,1>} #declare t4 = polygon{4,<1-s,-1,-1>,<1,-1+s,-1>,<1,-1,-1+s>,<1-s,-1,-1>} #declare t5 = polygon{4,<-1+s,1,1>,<-1,1-s,1>,<-1,1,1-s>,<-1+s,1,1>} #declare t6 = polygon{4,<-1+s,1,-1>,<-1,1-s,-1>,<-1,1,-1+s>,<-1+s,1,-1>} #declare t7 = polygon{4,<-1+s,-1,1>,<-1,-1+s,1>,<-1,-1,1-s>,<-1+s,-1,1>} #declare t8 = polygon{4,<-1+s,-1,-1>,<-1,-1+s,-1>,<-1,-1,-1+s>,<-1+s,-1,-1>} #declare thing = union { object{t1} object{t2} object{t3} object{t4} object{t5} object{t6} object{t7} object{t8} } #declare thing2 = object { thing bounded_by{p1} bounded_by{p2} bounded_by{p3} bounded_by{p4} bounded_by{p5} bounded_by{p6} bounded_by{p7} bounded_by{p8} clipped_by{bounded_by} } #declare shape = object { myCube bounded_by{p1} bounded_by{p2} bounded_by{p3} bounded_by{p4} bounded_by{p5} bounded_by{p6} bounded_by{p7} bounded_by{p8} clipped_by{bounded_by} } object {shape texture { T_Stone5}} object {thing2 texture { T_Wood4}}