// Entry code: qcdavh // Name : Mikihiko Nishiara // Frame rate: 6 #declare r = 2 * pi * clock; #declare h = r + sin(r) / 2; #declare camera_location = <-5 * sin(h), 1 + 1.4 * cos(h), -4.25 - 4 * cos(h)>; camera { location camera_location look_at 0 } light_source { <-2.5, 8, -6> color rgb <8, 9, 8> * 9 fade_distance 1 fade_power 2 } light_source { camera_location color rgb <8, 8, 9> * .1 fade_distance 1 fade_power 2 } #macro menger(pos, S) #if(vlength(pos - camera_location) < S * 30) #local s = S / 3; #local i = 0; #while(i < 27) #local X = mod(i, 3) - 1; #local Y = mod(div(i, 3), 3) - 1; #local Z = mod(div(i, 9), 3) - 1; #if((X = 0) + (Y = 0) + (Z = 0) < 2) menger(pos + * s, s) #end #local i = i + 1; #end #else box{ -.5, .5 pigment { color rgb 1 } scale S translate pos } #end #end menger(0, 3)