// Ad infinitum // by Alexandre Dorion November 2006 // for POVRay Short Code Contest - Round 4 // recursive macro to create spheres #macro Q(N) sphere { -.5,.5 translate <29.5-.6*N, 0, 48-.9*N> // diagonal line pigment {rgbf <.5,.7,.6,1>} //greenish glass finish {reflection .2} interior{ior 1.5} } #if(N) // if N>0 then call macro again Q(N-1) #end #end // bright light to create shadows light_source { 100, 3 } // dark ground plane { y,-1 pigment {rgb .1} } // call macro to draw 50 spheres Q(50) // ground fog to hide the horizon fog { fog_type 2 distance 9 rgb .9 fog_offset .1 fog_alt .5 turbulence 2 }