/* -------------------------- Entry: 0006 WWW: http:// Title: Mmmm... Donuts... Author: ---------------------------*/ // Entry for POVRay Fractal Raytracing Contest - 6 April 2004 // // This entry is more self-similar than fractal but it's in the spirit of the contest. // If only there were a "Most Borng Fractal" prize... :) #version 3.5; global_settings { assumed_gamma 1.0 } camera { location <0.3, 0.5, 0.1> direction 1.5*z right x*image_width/image_height look_at <0.7, 0.0, 0.7> } light_source { <0, 0, 0> // light's position (translated below) color rgb <1, 1, 1> // light's color translate <-30, 30, -30> shadowless } #macro MyTorus(majorRad, startTheta, endTheta, level) // skip the union at level 0 to avoid a zillion "should have more than one CSG object" warnings #if (level > 0) union { #end torus { majorRad majorRad*0.1 #if (mod(level,2) = 0) pigment { rgb 1 } #else pigment { rgb 0 } #end finish { reflection 0.2 } } // if we are not at level 0, space smaller MyTorus objects around this one #if (level > 0) #local theta = startTheta; #while (theta < endTheta) object { MyTorus(majorRad*0.2, 0, 360, level-1) rotate x*90 translate x*majorRad rotate y*theta } #declare theta = theta + 10; #end #end // close the union if we are not at level 0 #if (level > 0) } #end #end 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>] } } } object { MyTorus(1.0, 280, 350, 4) }