// Lily by Moonlight // Verbose version // Pete Hurst 13 Oct 2006 // Low dark light source creates ghostly night feel. light_source{y-4*z,.4} // This scene looks much better with radiosity but couldn't quite squeeze it into the byte count... // global_settings{radiosity{}} // Angle the camera down to hide the plain black sky and get a better view of the lily camera{rotate x*30} // Water plane for the lily to rest on plane{y,-1pigment{rgb.5+z}normal{waves}} // Recursive macro generates a ring of petals/leaves #macro P(c,r) sphere{y,1 // Position at <0,1,0> so scaling keeps the base at the origin scale/99 // Scale dependant upon what ring we're currently at rotate<4.5*r,c*360/(40-r),0> // Rotate into position ... I'm sure this can be shortened! pigment{rgb x+y*r/16} // Pigment varies depending on current ring translate 2*z-y // Translate to correct position for camera } #if(c)P(c-1,r)#end // Run macro again if we have more petals to create #end // Tried to implement this loop within the recursion to save a few bytes, // but parser kept dying with a "too many nested" error #local r=20; #while(r) P(40-r,r) // Create a ring. Each ring has successively more petals, which makes them alternate nicely // near the camera. #local r=r-1; #end