// Some Mushrooms Dancing // (C) Fergus C. Murray, April 2000 #version 3.0 global_settings { assumed_gamma 1.0 } camera { location < 0, 0, -30> direction 1*z look_at < 0, 0, 0> } background { color rgb <0.0, 0.0, 0.0> } light_source { <50, 20, -50> color rgb 1 } #declare BasicShape = union{ blob{ threshold 0.6 sphere { -1*z, 2, 1 } sphere { -1.5*z, 1, -1 } cylinder { -2*z, 0, 0.5, 0.75} } cylinder { -6*z, 0.0, 0.25} } // ------------------------------------------------------------------ // Set up the loop variables: // the Counter variable will go from 0.0 to 1.0 // in NumIterations loops. #declare NumIterations = 12 #declare Counter = 0.0 #declare Increment = 1.0/NumIterations #declare NumTwists = 360*3 // 3 full twists // Create an iterated object built from our basic shape union{ #declare Flipper = 1 // Flipper will switch between 1 and -1 each loop #while (Counter<1.0) object { BasicShape rotate NumTwists*(Counter)*x rotate y*clock*360 rotate x*(clock-Counter)*720 translate <8, 0, 0> rotate 360*Counter*z texture { pigment { color rgb <0,0.5+sin(Counter*1080)*0.5, 0.6+cos(Counter*360)*0.4> } finish { ambient 0.2 specular 0.5 roughness 0.08 } } } #declare Flipper = - Flipper #declare Counter=Counter+Increment #end }