#include "colors.inc" #include "metals.inc" #include "textures.inc" #declare tagger_red = <.8, .1, .1>; #declare tagger_green = <.1,.8,.1>; #declare camera_location = <0,0,-10>; #declare light_location = camera_location + <0,10,-20>; global_settings { max_trace_level 20 } background { color White } camera { location camera_location look_at <0,0,0> } light_source { light_location color <1,1,1> } //creates a spring resting at y=0 and centered around the y axis. #macro makeSpring (coilradius,wireradius,threadangle,coilheight) #local torushalf = torus { coilradius, wireradius clipped_by { plane {x 0} } } union { #local torusTranslation = coilradius*sin(radians(threadangle)); #local currentTorus = 0; #while (2*currentTorus* torusTranslation < coilheight) object { torushalf #local theSign = pow(-1,currentTorus); scale rotate <-theSign*threadangle,0,0> translate <0,2*currentTorus* torusTranslation,0> } #local currentTorus = currentTorus + 1; #end } #end #declare floater_finish = finish { phong .5 phong_size 140 ambient .8 } #declare Colors = seed(2); #macro floater(floater_width) sphere { #local floater_red = rand(Colors); #local floater_green = rand(Colors); #local floater_blue = rand(Colors); <0,0,0>,floater_width texture { pigment { color rgbf } finish { floater_finish } } } #end #declare springLength = 6; #declare springWidth = 1.4; union { object { makeSpring(springWidth,.1,12,springLength) translate <0,-springLength/2,0> texture { T_Brass_2D } } #declare floater_count = 18; #declare Locations = seed(1); #while (floater_count > 0) #declare x_loc = rand(Locations)*springWidth*.8-springWidth*.4; #declare y_loc = rand(Locations)*springLength-springLength*.5; #declare z_loc = rand(Locations)*springWidth*.8-springWidth*.4; object { floater(rand(Locations)*.7) translate } #declare floater_count = floater_count - 1; #end rotate <80,0,90> translate camera_location+<0,0,6> } object { floater(1) translate <-springWidth*2.2,springWidth,-springLength/2> texture { pigment { color rgb <.2,.2,1> } finish { floater_finish } } } plane { z,camera_location.z-2 pigment { Blue_Sky scale 10 } finish { ambient 1 } }