#local H = 5;	// deckhoehe
#local Eps = 1E-6;

#include "hufeisenpult.pov"
#include "rounded_box.pov"

#declare kartentank = 
    superellipsoid {
	<0.25, 0.25>
	scale <1, 0.5, 1>
	translate <0, 0.5, 0>
	texture {
	    pigment {
		color rgbf <0.1, 0.1, 0.1, 0.5>
	    }
	}
	finish {
	    ambient 0.1
	    diffuse 0.1
	    reflection .25
	    specular 1
	    roughness 0.001
	}
	interior {
	    ior 0.5
	}
    }

#declare panoramaschirm = 
    union {
	intersection {
	    difference {
		cylinder {
		    <0, 1.5, 0>, <0, 3.5, 0>, 5.7
		}
		cylinder {
		    <0, 1.5-Eps, 0>, <0, 3.5+Eps, 0>, 5.6
		}
	    }
	    rounded_box (<-4, 1.5, -7>, <4, 3.5, -3>, 0.5
	    )
	}
	texture { pigment { color 0 }}
    }


#declare tuer_neg = 
    object {
	rounded_box(<5, 0, -1>, <7, 3, 1>, 0.2)
    }

#declare zentrale = 
    union {
	difference {
	    cylinder {
		<0, 0, 0>, <0, 5, 0>, 6
	    }
	    cylinder {
		<0, 0-Eps, 0>, <0, 4+Eps, 0>, 5.7
	    }
	    cone {
		<0, 4, 0>, 5.7
		<0, H, 0>, 5
	    }
	    object {
		tuer_neg
	    }
	    object {
		tuer_neg
		rotate <0, 180, 0>
	    }
	    object {
		tuer_neg
		rotate <0, 270, 0>
	    }
	}
	object {		// 2. Pilot
	    hufeisenpult 
	    rotate <0, +90, 0>
	    translate <-1.5, 0, 2.8>
	}
	object {		// Pilot
	    hufeisenpult 
	    rotate <0, +90, 0>
	    translate <-0.5, 0, 2.8>
	}
	object {		// Kommandant
	    hufeisenpult 
	    rotate <0, +90, 0>
	    translate <+0.5, 0, 2.8>
	}
	object {		// 2. Kommandant
	    hufeisenpult 
	    rotate <0, +90, 0>
	    translate <+1.5, 0, 2.8>
	}

	union {
	    object {		// 2. Feuerleitoffizier
		hufeisenpult 
		rotate <0, +90, 0>
		translate <-0.5, 0, 0>
	    }

	    object {		// 2. Feuerleitoffizier
		hufeisenpult 
		rotate <0, +90, 0>
		translate <0.5, 0, 0>
	    }
	    translate <0, 0, -5>
	    rotate <0, +45, 0>
	}

	object {
	    kartentank
	    translate <+3.6, 0, -2>
	}
	object {
	    konturensitz
	    rotate <0, 180, 0>
	    translate <+2, 0, -2>
	}
	object {
	    konturensitz
	    rotate <0, -90, 0>
	    translate <+3.6, 0, -0.4>
	}
	object {
	    konturensitz
	    rotate <0, +90, 0>
	    translate <+3.6, 0, -3.6>
	}
	object {
	    panoramaschirm
	}

	texture { T_arkonstahl }
    }
