//The Big building into the distance

#declare BigB_Color1 = color srgb 1;
#declare BigB_Color2 = color srgb 0.6;
#declare BigB_GlassColor = color srgb < 0, 0.8, 1 >;
#declare BigB_GlassFinish = finish{ reflection{ 0.6 0.8 } }
#declare BigB_GlassTexture = texture{ pigment{ BigB_GlassColor } finish{ BigB_GlassFinish } }
#declare BigB_BarColor = color srgb 0.8;

#declare BigB_Radius = 20;
#declare BigB_FacetNumber = 18;
#declare BigB_HighStep1 = 5;
#declare BigB_HighStep2 = 4;
#declare BigB_HighGlassStep = 4;
#declare BigB_HighStep3 = 4;
#declare BigB_GlassFacetNumber = 36;
#declare BigB_GlassRadius = BigB_Radius - 1;
#declare BigB_GlassBarRadius = 0.1;

#declare BigB_Prism =
prism{
	linear_sweep linear_spline 0, 1, BigB_FacetNumber + 1
	#for( It, 0, BigB_FacetNumber - 1 )
		<	vrotate( < 0, 0, BigB_Radius >, < 0, -360 / BigB_FacetNumber * It, 0 >).x, 
			vrotate( < 0, 0, BigB_Radius >, < 0, -360 / BigB_FacetNumber * It, 0 >).z	>
	#end
	< 0, BigB_Radius >
}

#declare BigB_GlassPrism =
prism{
	linear_sweep linear_spline 0, 1, BigB_GlassFacetNumber + 1, 
	#for( It, 0, BigB_GlassFacetNumber - 1 )
		< 	vrotate( < 0, 0, BigB_GlassRadius >, < 0, -360 / BigB_GlassFacetNumber * It, 0 >).x, 
			vrotate( < 0, 0, BigB_GlassRadius >, < 0, -360 / BigB_GlassFacetNumber * It, 0 >).z	>
	#end
	< 0, BigB_GlassRadius >
}

#macro MakeGlassesBars()
	#for( It, 0, BigB_GlassFacetNumber - 1 )
		cylinder{ 
			vrotate( < 0, BigB_HighStep1 + BigB_HighStep2, BigB_GlassRadius >, < 0, 360 / BigB_GlassFacetNumber * It, 0 >), 
			vrotate( < 0, BigB_HighStep1 + BigB_HighStep2 + BigB_HighGlassStep, BigB_GlassRadius >, < 0, 360 / BigB_GlassFacetNumber * It, 0 >), 
			BigB_GlassBarRadius pigment{ BigB_BarColor } }
	#end
#end

#declare CompleteBigBuilding =
union{
	object{ BigB_Prism scale < 1, BigB_HighStep1, 1 > pigment{ BigB_Color2 } }
	object{ BigB_Prism scale < 1, BigB_HighStep2, 1 > translate BigB_HighStep1 * y pigment{ BigB_Color1 } }
	object{ BigB_GlassPrism scale < 1, BigB_HighGlassStep, 1 > translate ( BigB_HighStep1 + BigB_HighStep2 ) * y texture{ BigB_GlassTexture} }
	object{ BigB_Prism scale < 1, BigB_HighStep3, 1 > translate ( BigB_HighStep1 + BigB_HighStep2 + BigB_HighGlassStep ) * y pigment{ BigB_Color1 } }
	MakeGlassesBars()
}