// Fergus C. Murray's Snake Things In Space // (C) May 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 } light_source { <0, 0, -40> color rgb <1,0.7,0.4> } #declare BasicShape = // create a sphere shape sphere { 0,0.25 } // ------------------------------------------------------------------ // Set up the loop variables: // the Counter variable will go from 0.0 to 1.0 // in NumIterations loops. #declare NumIterations = 360 #declare Counter = 0.0 #declare Increment = 1.0/NumIterations #declare Arm = 1 #declare armangle = 0.0 #declare NumTwists = 360*4 union{ #declare Flipper = 1 // Flipper will switch between 1 and -1 each loop #while (Counter<1.0) object { BasicShape scale 3-Counter*2 translate x*4 rotate 15*cos((Counter*2-clock)*pi*2)*z rotate x*(NumTwists*Counter) translate <12*(Counter), 0, 0> rotate armangle*z #declare armangle=armangle+90 texture { pigment { color rgb <1-Counter/2, 1-sqrt(Counter), 0.2+0.2*cos(Counter*720)> } finish { ambient 0.1 specular 0.4 roughness 0.2 } } } #declare Flipper = - Flipper #declare Counter=Counter+Increment #end }