#include "colors.inc"
#include "shapes.inc"
#include "textures.inc"
#include "metals.inc"
#include "glass.inc"
#include "ynkelonium_texture.pov"
#include "T_BlackMetal.pov"
#include "Triebwerk.pov"

#declare Hangars_Kugelschale_neg = 
    difference {
	union {
	    #declare i = 0;
	    #while (i < 360) 
		union {
		    box {
			<-80, 1030, 0>
			< 80, 950, 2500>
		    }
		    box {
			<-100, -850, 0>
			< 100, -930, 2500>
		    }
		    rotate <0, i, 0>
		}
		union {
		    box {
			<-100, 730, 0>
			< 100, 650, 2500>
		    }
		    box {
			< 180, 520, 2500>
			<-180, 400, 0>
		    }
		    box {
			<-180, -400, 0>
			< 180, -520, 2500>
		    }
		    rotate <0, i+15, 0>
		}
		#declare i = i + 30;
	    #end
	}
	sphere {
	    <0, 0, 0>, 1240
	}
	texture {
	    Ynkelonium_Texture
	}
    }

#declare Geschuetze_Huelle_oben =
    union {
	#declare w = 30;
	#while (w <= 60) 
	    #declare i = 0;
	    #while (i < 360) 
		union {
		    sphere {
			<0, 0, 0> 20
		    }
		    cone {
			<0, 0, 0> 10
			<30, 30, 0> 5
		    }
		    cone {
			<0, 0, 0> 10
			<30, -30, 0> 5
		    }
		    translate <1250, 0, 0>
		    rotate <0, 0, w>
		    rotate <0, i, 0>
		}
		#declare i = i + 10;
	    #end
	    #declare w = w + 15;
	#end
	texture {
	    Ynkelonium_Texture
	}

    }

#declare Geschuetze_Huelle_unten =
    union {
	#declare w = -55;
	#while (w <= -35) 
	    #declare i = 0;
	    #while (i < 360) 
		union {
		    sphere {
			<0, 0, 0> 20
		    }
		    cone {
			<0, 0, 0> 10
			<30, 30, 0> 5
		    }
		    cone {
			<0, 0, 0> 10
			<30, -30, 0> 5
		    }
		    translate <1250, 0, 0>
		    rotate <0, 0, w>
		    rotate <0, i, 0>
		}
		#declare i = i + 10;
	    #end
	    #declare w = w + 20;
	#end
	texture {
	    Ynkelonium_Texture
	}

    }

#declare Kugelschale = 
    union {
	sphere {
	    <0,0,0>, 1250
	    texture {
		Ynkelonium_Texture
	    }
	}
	object {Geschuetze_Huelle_oben}
	object {Geschuetze_Huelle_unten}
    }

#declare R1 = 1250;
#declare R2 =  400;
#include "ringwulst.pov"

#declare Landestuetzen =
    union {
	#declare i = 15;
	#while (i < 360)
	    cone {
		<0, 0, 0>, 100
		<0, 10, 0>, 100
		translate <0, -1260, 0>
		rotate <45, 0, 0>
		rotate <0, i, 0>
		texture {
		    pigment { color rgb <0.7, 0.5, 0.7> }
		    finish {
			ambient 0.2
			diffuse 0.35
			specular 0.55
			roughness 0.1
			reflection 0.25
			brilliance 1.0
		    }
		}
	    }
	    #declare i = i + 30;
	#end
    }

#declare SZ = 
union {
    difference {
	object {
	    Kugelschale
	}
	object {
	    Hangars_Kugelschale_neg
	}
    }
    object {
	Ringwulst
    }
    object {
	Landestuetzen
    }
}

