global_settings {
	max_trace_level 20
}

#include "curvetri.inc"
#include "transforms.inc"

#declare CURVED = .75;
#declare CURVE_ANGLE = pi/16;

camera {
	location <10,4,-7>
	look_at -y/2
}

union {
	#declare C = 0;
	#declare X = -1;
	#while (X <= 1)
		#declare Z = -1;
		#while (Z <= 1)
			#declare CURVED = C / 9;
			union {
				curved_triangle(y/2,y,x,x+y,-z,y-z)
				rotate <-45,0,-45>
				translate (x*X+z*Z)*3+y/3
			}
			#declare C = C + 1;
		#declare Z = Z + 1;
		#end
	#declare X = X + 1;
	#end
	pigment {color rgb 1}
	finish {specular 1 roughness .01 reflection .5}
}

plane {y,-1 pigment{color green 1}}

plane {
	-y,-50
	pigment {
		bozo
		color_map {
			[0 color blue 1]
			[.5 color blue 1]
			[1 color rgb 1]
		}
		scale 100
	}
	finish {
		ambient 1
	}
}


cylinder {
	-y,-y/2,5
	texture {
		pigment {
			color rgb .5
		}
		finish {
			specular .75
		}
		normal {
			bumps 1
			scale 1/16
		}
	}
}

#declare C = 0;
#while (C < 24)
	union {
		cylinder {-x-y,y*5-x,1/4}
		cylinder {x-y,x+y*5,1/4}
		cylinder {y*5-x,y*5+x,1/4}
		sphere {y*5-x,1/4}
		sphere {y*5+x,1/4}
		texture {
			pigment {
				color rgb .5
			}
		}
		translate z*15
		rotate y*15*C
	}
#declare C = C + 1;
#end

light_source {<5,5,-5>*10 color rgb 1}