#version 3.5; #include "colors.inc" global_settings { assumed_gamma 1.2 } camera { location <0.0, 3.0, -9.0> direction 1.5*z right x*image_width/image_height look_at <0.0, 0.0, 0.0> } sky_sphere { pigment { gradient y color_map { [0.0 rgb <0.6,0.7,1.0>] [0.7 rgb <0.0,0.1,0.8>] } } } union { light_source { <0, 0, 0> color rgb <1, 0.5, 0.5> translate <-3, 3, -3> } light_source { <0, 0, 0> color rgb <0.5, 1, 0.5> translate <3, 3, -3> } light_source { <0, 0, 0> color rgb <0.5, 0.5, 1> translate <3, 3, 3> } light_source { <0, 0, 0> color rgb <0.5, 1, 1> translate <-3, 3, 3> } scale 3 } // ---------------------------------------- plane { y, -1 pigment { color rgb <0.7,0.5,0.3> } } #macro cubef(neg,pos,mode,eq,depth) #if (depth <= 0) box { neg, pos } #else union { #local divisions = 3; #local d = (pos - neg) / divisions; #local qx = 0; #while (qx < divisions) #local qy = 0; #while (qy < divisions) #local qz = 0; #while (qz < divisions) #if ( mode = 1 ? (qx = 1) + (qy = 1) + (qz = 1) != eq : (qx = 1) + (qy = 1) + (qz = 1) = eq ) cubef(neg + d * , neg + d * ( + 1), mode, eq, depth - 1) #end #local qz = qz + 1; #end #local qy = qy + 1; #end #local qx = qx + 1; #end } #end #end union { object { cubef(<-1, -1, -1>, <1, 1, 1>, 0, 3, 3) translate -7.7*x } object { cubef(<-1, -1, -1>, <1, 1, 1>, 0, 2, 3) translate -5.5*x } object { cubef(<-1, -1, -1>, <1, 1, 1>, 0, 1, 3) translate -3.3*x } object { cubef(<-1, -1, -1>, <1, 1, 1>, 0, 0, 3) translate -1.1*x } object { cubef(<-1, -1, -1>, <1, 1, 1>, 1, 0, 3) translate +1.1*x } object { cubef(<-1, -1, -1>, <1, 1, 1>, 1, 1, 3) translate +3.3*x } object { cubef(<-1, -1, -1>, <1, 1, 1>, 1, 2, 3) translate +5.5*x } object { cubef(<-1, -1, -1>, <1, 1, 1>, 1, 3, 3) translate +7.7*x } texture { pigment { color rgb 1 } } }