global_settings { assumed_gamma 1.0 } default { pigment { rgb 0 } } background { rgb 1 } #declare c1 = camera { location <0,2.25,0> look_at <0,0,0> } #declare c2 = camera { location <-1.25,.5,-1.25> look_at <.75,-1,.25> } #declare Color = false; #declare p1 = <-1,0,-1>; #declare p2 = < 1,0,-1>; #declare p3 = < 0,0, 1>; camera { c1 } light_source { y*1000 rgb 1 shadowless } #macro Tetra2d(a,L) #declare b = union { object { a scale .5 translate p1*0.5 #if(Color) pigment { rgb <1,0,0> } #end } object { a scale .5 translate p2*0.5 #if(Color) pigment { rgb <0,1,0> } #end } object { a scale .5 translate p3*0.5 #if(Color) pigment { rgb <0,0,1> } #end } } #undef a #if(L>1) Tetra2d(b,L-1) #else object { b } #end #end #declare base_object = triangle { p1,p2,p3 } object { Tetra2d( base_object , 1 ) }