#include "colors.inc"
#include "shapes.inc"
#include "textures.inc"
#include "metals.inc"
#include "stones.inc"


global_settings {
        assumed_gamma 1.0
        ambient_light rgb<0.1, 0.1, 0.1>
	#if (0)
	radiosity {
	    distance_maximum 10000
	}
	#end
}

light_source {
    <1E11, 1E11, 1E11>
    color White
}

#if (0)
light_source {
    <2000, 2000, -2000>
    color rgb <0.8, 0.8, 1>
}
#end

//#declare Camera_Totale = 1;
//#declare Camera_Frosch = 1;
//#declare Camera_Triebwerk = 1;
//#declare Camera_Pol = 1;
#declare Camera_Vogel = 1;

#ifdef (Camera_Vogel)
camera {
        location <4000, 2000, 1000>
	right <0.5, 0, 0>
	up <0, 0.75, 0>
        look_at <0, 700, 0>
}
#end
#ifdef (Camera_Frosch)
camera {
        location <4000, 2, 0>
        look_at <0, 800, 0>
	angle 40
}
#end

#ifdef (Camera_Pol)
camera {
        location <1, 4700, 0>
        look_at <0, 1800, 0>
	angle 40
}
#end

#ifdef (Camera_Triebwerk)
camera {
        location <1650, 1700, 0>
        look_at <650, 1500, 0>
}
#end

#ifdef (Camera_Totale)
camera {
        location <+4000, 900, 0>
        look_at <0, 900, 0>
	angle 40

}
#end


#macro warnkreis (r1, r2, st)
// r1 ... inner radius
// r2 ... outer radius
// st  ... step width
    union {
	#local i = 0;
	#while (i < 360)
	    polygon {
		5
		<r1 * cos(radians(i-st)), r1 * sin(radians(i-st))>
		<r1 * cos(radians(i-0)), r1 * sin(radians(i-0))>
		<r2 * cos(radians(i+st)), r2 * sin(radians(i+st))>
		<r2 * cos(radians(i+0)), r2 * sin(radians(i+0))>
		<r1 * cos(radians(i-st)), r1 * sin(radians(i-st))>
		pigment { color Yellow }
	    }
	    #local i = i + st;
	    polygon {
		5
		<r1 * cos(radians(i-st)), r1 * sin(radians(i-st))>
		<r1 * cos(radians(i-0)), r1 * sin(radians(i-0))>
		<r2 * cos(radians(i+st)), r2 * sin(radians(i+st))>
		<r2 * cos(radians(i+0)), r2 * sin(radians(i+0))>
		<r1 * cos(radians(i-st)), r1 * sin(radians(i-st))>
		pigment { color 0.1 }
	    }
	    #local i = i + st;
	#end
	rotate <90, 0, 0>
	translate <0, 0.01, 0>
    }
#end

#declare scheinwerfer_color =
    color 0.5 * White;

difference {
    union {
	sphere {
	    <0, 0, 0>, 3476000/2
	    translate <0, -3476000/2, 0>

	}
	torus {
	    50000, 3400
	    translate <0, 2680, 0>
	}
	#if (0)
	torus {
	    10000, 100
	    translate <0, sqrt(1738000*1738000-10000*10000)-1738000, 0>
	    texture {
		pigment { color rgb <0.9, 0.9, 0.9> }
	    }
	}
	torus {
	    20000, 100
	    translate <0, sqrt(1738000*1738000-20000*20000)-1738000, 0>
	    texture {
		pigment { color rgb <0.9, 0.9, 0.9> }
	    }
	}
	torus {
	    30000, 100
	    translate <0, sqrt(1738000*1738000-30000*30000)-1738000, 0>
	    texture {
		pigment { color rgb <0.9, 0.9, 0.9> }
	    }
	}
	torus {
	    40000, 100
	    translate <0, sqrt(1738000*1738000-40000*40000)-1738000, 0>
	    texture {
		pigment { color rgb <0.9, 0.9, 0.9> }
	    }
	}
	#end
	difference {
	    cylinder {
		<0, -720, 0>, <0, 2680, 0>, 56800
	    }
	    cylinder {
		<0, -721, 0>, <0, 2681, 0>, 43200
	    }
	    torus {
		43200, 3400
		translate <0, 2680, 0>
	    }
	    torus {
		56800, 3400
		translate <0, 2680, 0>
	    }
	}
	warnkreis(1000, 1010, 1)
	light_source {
	    <-1400, -100, -1400>
	    color scheinwerfer_color
	}
	light_source {
	    <-1400, -100, +1400>
	    color scheinwerfer_color
	}
	light_source {
	    <-1400, -100, +1400>
	    color scheinwerfer_color
	}
	light_source {
	    <+1400, -100, -1400>
	    color scheinwerfer_color
	}
	light_source {
	    <-1400, -1900, -1400>
	    color scheinwerfer_color
	}
	light_source {
	    <-1400, -1900, +1400>
	    color scheinwerfer_color
	}
	light_source {
	    <-1400, -1900, +1400>
	    color scheinwerfer_color
	}
	light_source {
	    <+1400, -1900, -1400>
	    color scheinwerfer_color
	}
	texture {
	    pigment { color rgb <0.7, 0.7, 0.9> }
	    //finish { F_MetalA }
	}
    }
    cylinder {
	<0, 1, 0>, <0, -2000, 0>, 1000
	texture {
	    pigment { color rgb <0.7, 0.7, 0.9> }
	    finish { F_MetalA }
	}
    }
    box {
	<-1500, -2000, -1500>
	<+1500,   -50, +1500>
	texture {
	    pigment { color rgb <1.0, 1.0, 1.0> }
	    //finish { F_MetalB }
	}
    }
}

#include "entdecker.pov"

#local t1 = 10;
#local t2 = 30;
#local t3 = 50;
#local t4 = 60;
#switch (clock) 
    #range (0, t1)
	#local elev = -2000
	#break
    #range (t1, t2)
	#local elev = (clock-t1)/(t2-t1);
	#local elev = elev*elev;
	#local elev = elev * 1000 - 2000;
        #break;
    #range (t2, t3)
	#local elev = (clock-t3)/(t2-t3);
	#local elev = elev*elev;
	#local elev = - elev * 1000;
        #break;
    #range (t3, t4)
	#local elev = 0;
	#break;
#end
#if (1)
union {
    cylinder {
	<0, -50, 0>, <0, 0, 0>, 1000
	texture {
	    pigment { color rgb <0.7, 0.7, 0.9> }
	    finish { F_MetalA }
	}
    }
    warnkreis(990, 1000, 1)

    object {
	entdecker
	translate <0, 930, 0>
    }

    translate <0, elev, 0>
}
#end

#if (0)
sphere {
    <0, 0, 0>, 2000
    texture {
	pigment {
	    rgbf 1
	}
    }
    interior {
	media {
	    scattering {
		4,
		0.8
	    }
	}
    }
}
#end


background { color <0, 0, 0.2> }
