// das kabinett -- hall of mirrors reloaded
// 9/2017 christian perle

global_settings {
	#max_trace_level 20
}

#declare A = seed(10110);

camera {
	location <.15, 2.1, -.7>
	direction <0, 0, 1.5>
	look_at <0, 2, 0>
	rotate -8*z
}

#declare TMirror = union {
	box {
		<-2, 0, 0>, <2, 8, .1>
		pigment { rgb 1 }
		finish { ambient 0 diffuse .1 reflection 1 }
		normal { bozo .002 scale .2 }
	}
	cylinder {
		<2, 0, 0>, <2, 8, 0>, .5
		hollow
		pigment {
			crackle
			frequency 5
			scale .5
			color_map {
				[0 color rgbf<rand(A), rand(A), rand(A), .9>]
				[0.5 color rgbf<rand(A), rand(A), rand(A), .9>]
				[1 color rgbf<rand(A), rand(A), rand(A), .9>]
			}
		}
	}
	light_source { <1.78, 1, -.2> color rgb 1 }
	translate 1.1*z
}

union {
	object { TMirror }
	object { TMirror rotate 120*y }
	object { TMirror rotate 240*y }
}

sphere {
	0, .5
	pigment {
		spiral2 7
		rotate 90*x
		frequency 12
		color_map {
			[0 color rgbf 1]
			[0.5 color rgbf 1]
			[0.5 color rgbf<1, 1, 1, .7>]
			[1 color rgbf<1, 1, 1, 0>]
		}
	}
	translate .5*y
}

plane {
	y, 0
	pigment { rgb 1 }
}