
//Manta
#declare Manta_Stop = 0.7
#declare Manta_Phare = 1
#declare Roue =
union {
torus {1-1/6, 1/6 rotate <90, 0, 0>pigment {Black}finish {specular 0.1 roughness 0.05}}
union {
difference {
cylinder { <0, 0, -1/6+1/20>, <0, 0, 1/6-1/20>, 1-1/6+1/20}
sphere { <0, 0, 0>, 1 scale <0.65, 0.65, 1/6> translate <0, 0,-1/6>}
sphere { <0, 0, 0>, 1 scale <0.65, 0.65, 1/6> translate <0, 0, 1/6>}
#declare NbrTrou = 8
#declare Count = 0
#while (Count < NbrTrou)
cylinder { <0, 0, -1>, <0, 0, 1>, 0.05 translate <0.45, 0, 0> rotate<0, 0, Count * (360/NbrTrou)> }
#declare Count = Count +1
#end
}
sphere {<0, 0, 0>, 1/10} finish { reflection Gold ambient 0 diffuse 0 }} scale <1, 1, 6>}
#declare Sc = 0.5
#declare Manta_Skin =
texture {pigment { crackle color_map {[0.0 color DarkGreen][1.0 color ForestGreen]} turbulence 0.3 scallop_wave scale <1/2, 1/8, 1/8> }}
#declare Manta_Text =
texture { Manta_Skin Shiny Phong_Shiny}
#declare Manta_Blob =
blob { threshold 0.6 sphere {<0, 0, 0>, 1, 1 scale <2.25, 1/5, 1>}
cylinder {<-1, 0, 0>, <1, 0, 0>, 1, -10 scale <1, 10, 10>translate <3, 0, 0>}
cylinder {<0, -1, 0>, <0, 1, 0>, 1, -10 scale <10, 1, 10>translate <0, -1.9, 0>}
sphere {<0, 0, 0>, 1, -1 scale <3, 1/8, 1/2>translate <2, 0, 0>}

//Cockpit
sphere {<0, 0, 0>, 1, 1scale <0.8, 1/2, 0.6>translate <Sc, 1/2 * Sc, 0>}
sphere {<0, 0, 0>, 1, 0.8scale <1.2, 1/4, 0.6>translate <3/4 * Sc, 1/4 * Sc, 0>}
sphere {<0, 0, 0>, 1, 0.8scale <1, 1/4, 1/2>translate <-1 * Sc, 1/8 * Sc, 0>}

// Train Avant
cylinder {<0, 0, -1>, <0, 0, 1>, 1, 1scale <1/2, 1/2, 1/8>translate <-1.75 * Sc, 0, -0.75 * Sc>}
cylinder {<0, 0, -1>, <0, 0, 1>, 1, -5scale <0.18, 0.18, 0.15>translate <-1.75 * Sc, 0, -1 * Sc>}
cylinder {<0, 0, -1>, <0, 0, 1>, 1, 1scale <1/2, 1/2, 1/8>translate <-1.75 * Sc, 0, 0.75 * Sc>}
cylinder {<0, 0, -1>, <0, 0, 1>, 1, -5scale <0.18, 0.18, 0.15>translate <-1.75 * Sc, 0, 1 * Sc>}

//Transmition
cylinder {<0, 0, -1>, <0, 0, 1>, 1, 2scale <0.05, 0.05, 0.15>translate <-1.75 * Sc, 0, 0>}

//Train Arriere
sphere {<0, 0, 0>, 1, 1scale <2/3, 1/2, 1/4>translate <1.5 * Sc, 0, -0.8 * Sc>}
cylinder {<0, 0, -1>, <0, 0, 1>, 1, -5scale <0.18, 0.18, 0.2>translate <1.5 * Sc, 0, -1 * Sc>}
sphere {<0, 0, 0>, 1, 1scale <2/3, 1/2, 1/4>translate <1.5 * Sc, 0, 0.8 * Sc>}
cylinder {<0, 0, -1>, <0, 0, 1>, 1, -5scale <0.18, 0.18, 0.2>translate <1.5 * Sc, 0, 1 * Sc>}

//Transmition
cylinder {<0, 0, -1>, <0, 0, 1>, 1, 5scale <0.05, 0.05, 0.1>translate <1.5 * Sc, 0, 0>}

//Transmition
cylinder {<-1, 0, 0>, <1, 0, 0>, 1, 5scale <0.43, 0.05, 0.05>translate <-0.07, -0.025, 0>}

//Phares
sphere {<0, 0, 0>, 1, 0.9scale <0.06, 0.03, 0.1>rotate <-20, 20, 0>translate <-1.1, 0.1, 0.3>}
sphere {<0, 0, 0>, 1, 0.9scale <0.06, 0.03, 0.1>rotate <20, 20, 0>translate <-1.1, 0.1, -0.3>}
sturm hierarchy off }

#declare Vitre_Trou =
union {
superellipsoid {<0.2, 0.2>scale <1/2, 0.06, 0.2>translate <0, 0.35, 0>}
superellipsoid {<0.5, 0.5>scale <1/4, 0.04, 0.12>translate <1, 0.38, 0>}}

#declare Feu_A_Trou =
sphere {<0, 0, 0>, 1 scale<0.1, 0.02, 0.08> translate <1, 0.2, -0.35> }

#declare Feu_D_Trou =
sphere { <0, 0, 0>, 1 scale <0.06, 0.03, 0.1> rotate <20, 20, 0> scale <2, 1, 1> translate <-1.1, 0.1, -0.3> }

#declare Feu_Arriere_Trou =
union {
object {Feu_A_Trou }
object {Feu_A_Trou scale <1, 1, -1>}
}

#declare Feu_Devant_Trou =
union {
object {Feu_D_Trou }
object {Feu_D_Trou scale <1, 1, -1>}
}

#declare Vitre_Corps =
union {
superellipsoid {<0.3, 0.3>scale <1/2, 0.05, 0.19>translate <0, 0.35, 0>}
superellipsoid {<0.55, 0.55>scale <1/4, 0.032, 0.11>translate <1, 0.38, 0>}
}

#declare Manta_Trou =
difference {
object { Manta_Blob }
box {<-0.005, 0, -0.29> <0.005, 5, 0.29>translate <0.55, 0.25, 0>}
box {<-1, 0, -0.335> <0, 0.005, 0.335>translate <0.55, 0.27, 0>}
box {<-1, -5, -0.005> <5, 5, 0.005>rotate <0, -12, 0>translate <0.6, 0, -0.28>}
box {<-1, -5, -0.005> <5, 5, 0.005>rotate <0, 12, 0>translate <0.6, 0, 0.28>}
}

#declare Feu_A =
intersection {
object { Manta_Blob }
object { Feu_A_Trou }
texture {T_Glass3 pigment { Red }normal {crackle scale <0.01, 0.01, 0.01>}finish { ambient Manta_Stop }}
}

#declare Feu_D =
intersection {
object { Manta_Blob }
object { Feu_D_Trou }
texture {T_Glass3 pigment { White }finish { ambient Manta_Phare }}
}

#declare Manta_Corps =
union {
difference {
union {
object { Manta_Trou }
object {Manta_Blob scale <0.99, 0.99, 0.99> }
}
object { Vitre_Trou }
object { Feu_Arriere_Trou }
object { Feu_Devant_Trou }
#declare Inv = -1
#while (Inv < 2)
#declare Count = 0
#while (Count < 5)
cylinder {<-1, 0, 0>, <1/8, 0, 0>, 1-1/8 scale <0.5, 0.07, 0.02>rotate <60+Count, 0, 0>rotate <0, -15, -20-Count>translate <-0.1*Count, 0.15, -0.22 + 0.02*Count>scale <1.0, 1.0, Inv>
}
#declare Count=Count+1
#end
#declare Inv=Inv+2
#end
}
#declare Inv = -1
#while (Inv < 2)
#declare Count = 0
#while (Count < 5)
torus { 1-1/8, 1/8 rotate <90, 90, 0> scale <0.5, 0.07, 0.02> rotate <60+Count, 0, 0> rotate <0, -15, -20-Count> translate <-0.1*Count, 0.15, -0.22 + 0.02*Count> scale <1.0, 1.0, Inv> }
#declare Count=Count+1
#end
#declare Inv=Inv+2
#end
texture { Manta_Text }
}

#declare Manta_Vitre =
intersection {
object { Manta_Blob }
object { Vitre_Corps }
texture {finish {reflection Gold/2ambient 0diffuse 0}}}

#declare Manta_Tour_Vitre =
difference {
intersection {
object { Manta_Blob }
object { Vitre_Trou }
}
object { Vitre_Corps } texture {pigment { Black }finish { Shiny }finish { Phong_Shiny }}
}

#declare Manta_Feux =
union {
object { Feu_A }
object {Feu_A scale <1, 1, -1>}
object { Feu_D } object {Feu_D scale <1, 1, -1>}
}

#declare Manta_roh =
union {
union {
object { Manta_Corps }
object { Manta_Vitre }
object { Manta_Tour_Vitre }
object { Manta_Feux }
scale 5/3
}
light_source {
<1.1, 0.2, -0.35>*5/3
color Red*Manta_Stop
spotlight
point_at <2.1, 0.1, -0.35>*5/3
radius 40 falloff 45 fade_distance 1 fade_power 2 atmospheric_attenuation on
}
 light_source {
<1.1, 0.2, 0.35> *5/3
color Red*Manta_Stop
spotlight
point_at <2.1, 0.1, 0.35>*5/3
radius .5 falloff 45 fade_distance 2 fade_power 2 atmospheric_attenuation on }
#if (Manta_Phare)
light_source {
<-1.2, 0.1, -0.3> *5/3
color White
spotlight
point_at <-2.2, 0.05, -0.3>*5/3
radius .5 falloff 25 fade_distance 5 fade_power 2 atmospheric_attenuation on
}
light_source {
<-1.2, 0.1, 0.3> *5/3
color White
spotlight
point_at <-2.2, 0.05, 0.3>*5/3
radius .5 falloff 25 fade_distance 5 fade_power 2 atmospheric_attenuation on }
#else
#end
}
#declare Manta =
union {
object { Manta_roh }
object {Roue scale <0.2, 0.2, 0.1>translate <-1.7*Sc*5/3, 0, -1*Sc*5/3 +0.05>}
object {Roue scale <0.2, 0.2, 0.1>translate <-1.7*Sc*5/3, 0, 1*Sc*5/3 -0.05>}
object {Roue scale <0.225, 0.225, 0.15>translate <1.5*Sc*5/3, 0.025, -1*Sc*5/3 +0.1>}
object {Roue scale <0.225, 0.225, 0.15>translate <1.5*Sc*5/3, 0.025, 1*Sc*5/3 -0.1>}
}
