#include "functions.inc" #declare position = 1; #declare lumiere = 1; #declare angle_anneaux = -30; #declare R=seed(1); sky_sphere {pigment { granite color_map { [ 0.000 0.270 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ] [ 0.270 0.275 color rgb <.5,.5,.4> color rgb <.8,.8,.4> ] [ 0.275 0.470 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ] [ 0.470 0.475 color rgb <.4,.4,.5> color rgb <.4,.4,.8> ] [ 0.475 0.680 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ] [ 0.680 0.685 color rgb <.5,.4,.4> color rgb <.8,.4,.4> ] [ 0.685 0.880 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ] [ 0.880 0.885 color rgb <.5,.5,.5> color rgb < 1, 1, 1> ] [ 0.885 1.000 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ] } turbulence 1 sine_wave scale .5 } } //caméra et lumières #switch (position) #case (1) camera { location <0,2,-15> look_at 0 } #break #case (2) camera { location <0,15,-10> look_at 0 } #break #case (3) camera { location <-5,3,-20> look_at 0 } #break #end #switch (lumiere) #case (1) light_source { <-15,0,-10> color rgb 0.5 } light_source { <-1,3,-16> color rgb 1 } #break #case (2) light_source { <-5,3,-20> color rgb 1 } #break #end // planète #declare T_Jupiter = texture { pigment { gradient y warp {turbulence 0.4 octaves 2} color_map { [0 color rgb <1.000,0.000,0.000>] [0.2 color rgb <1.000,0.545,0.000>] [0.4 color rgb <1.000,0.761,0.000>] [0.6 color rgb <1.000,0.961,0.000>] [0.8 color rgb <1.000,0.478,0.000>] [1 color rgb <1.000,0.000,0.000>] } scale 2 warp {black_hole <0,-3*sin(pi/6),-3*cos(pi/6)>,1.3 falloff 1 inverse strength 1.5 } } } sphere { <0,0,0>, 3 texture {T_Jupiter} interior {ior 1 fade_distance 1 } normal {ripples 0.07 rotate -50*z rotate -20*y scale 3 frequency 7 warp {turbulence 0.4} } rotate 20*y rotate angle_anneaux*z } // anneaux #declare T_anneau = texture{ pigment { granite color_map { [0 color rgb <1.000,0.945,0.945>] [0.3 color rgb <0.667,0.518,0.518>] [0.7 color rgb <0.835,0.612,0.341>] [1 color rgb <1.000,0.945,0.945>] } } finish { ambient 0.1 reflection 0.2 metallic conserve_energy brilliance 2 } normal {bumps 3 scale 0.07} } #macro anneau (R1,R2,hauteur,nombre, a1,a2) // anneau dans le plan xz #declare compteur = 0; union { #while (compteur texture {T_anneau } } #end rotate angle_anneaux*z } #end anneau (5,6,0.3,300,0.01,0.1) anneau (6,7,0.3,600,0.01,0.03) anneau (7,8,0.3,300,0.01,0.1) anneau (4.5,9,0.5,5,0.2,0.8) anneau (8,9,0.3,200,0.01,0.03) anneau (9,10,0.2,100,0.01,0.02) // satellite #declare T_Panneau = texture { pigment {boxed scale <0.5,0.25,1000> translate <0.25,0.125,0> warp {repeat <0.5,0,0>} warp {repeat <0,0.25,0>} color_map { [0 color rgb <0,0,0>] [0.6 color rgb <0,0.088,0.023>] [0.8 color rgb <0,0.175,0.047>] [1 color rgb <0.000,0.349,0.094>] } } finish { reflection 0.1 metallic phong 0.7 conserve_energy } } #declare T_Bras= texture { pigment {color rgb <0.94, 0.93, 0.80>} finish { ambient 0.25 brilliance 4 diffuse 0.5 metallic specular 0.80 roughness 1/80 reflection 0.5 } normal {facets coords 0.3} } #declare T_Corps = texture { pigment {color rgb <0.65, 0.55, 0.15>} finish { ambient 0.1 brilliance 6 diffuse 0.7 metallic specular 0.80 roughness 1/120 reflection 0.8 } normal {facets coords 0.5} } #declare Panneau=union { // panneau, x entre -2 et 2 box{<-2,-0.5,-0.1><2,0.5,0.1> texture {T_Panneau} } } #declare Bras =union { // bras, x entre -1.5 et 1.5 cylinder{<-1.5,0,0>,<0,0.3,0>,0.1} cylinder{<-1.5,0,0>,<0,-0.3,0>,0.1} cylinder{<-1.5,0,0>,<0,0,0.3>,0.1} cylinder{<-1.5,0,0>,<0,0,-0.3>,0.1} cylinder{<1.5,0,0>,<0,0.3,0>,0.1} cylinder{<1.5,0,0>,<0,-0.3,0>,0.1} cylinder{<1.5,0,0>,<0,0,0.3>,0.1} cylinder{<1.5,0,0>,<0,0,-0.3>,0.1} sphere {<0,0.3,0>,0.13} sphere {<0,0,0.3>,0.13} sphere {<0,-0.3,0>,0.13} sphere {<0,0,-0.3>,0.13} texture {T_Bras} } #declare Raccord = union {//boule de raccord sphere {<0,0,0>,0.3 texture {T_Bras} } } #declare Corps = union {//corps, cube de -2 à +2} box {<-2,-2,-2>,<2,2,2> texture {T_Corps} } cylinder {<-1,1.99,-1>,<-1,3.5,-1>,0.05 texture {T_Bras}} sphere {<-1,3.5,-1>,0.25 texture {T_Corps} } cylinder {<1,1.99,-1>,<1,4.5,-1>,0.05 texture {T_Bras}} sphere {<1,4.5,-1>,0.25 texture {T_Corps} } cylinder {<-1,1.99,1>,<-1,4,1>,0.05 texture {T_Bras}} sphere {<-1,4,1>,0.25 texture {T_Corps} } cylinder {<1,1.99,1>,<1,3,1>,0.05 texture {T_Bras}} sphere {<1,3,1>,0.25 texture {T_Corps} } cylinder {<0,1.99,0>,<0,5,0>,0.1 texture {T_Bras} } sphere {<0,5,0>,0.4 texture {T_Corps finish {ambient 1 } } } difference { cone {<0,-1.99,0>,0.3,<0,-3.5,0>,1.2} cone {<0,-2.1,0>,0.2,<0,-3.51,0>,1.2} texture {T_Bras} } lathe { cubic_spline 8, <-1,-3.4>,<0,-3.4>,<1.18,-3.5>,<1.5,-5.5>,<0.4,-9>,<0.25,-10>,<0,-9.5>,<-1,-9.5> hollow pigment {color rgbt <1,1,1,1> } interior { media { emission 1 intervals 1 samples 5 method 3 density { gradient y translate <0,3.5,0> scale <1,3.5,1> turbulence 1 color_map { [0.0 color rgb <0, 0, 0>] [0.1 color rgb <1, 0, 0>] [1.0 color rgb <1, 1, 0>] } } } } } } #declare satellite = union { union { union { object {Panneau translate <-2,0,0> rotate <20,-20,0>} object {Raccord} object {Bras translate <1.5,0,0>} translate <-3,0,0> rotate <0,25,25> } union { object {Raccord} object {Bras translate <1.5,0,0>} } translate <-3,0,0> rotate <0,0,-20> translate <-2,0,0> } object {Raccord translate <-2,0,0>} object {Corps} object {Raccord translate <2,0,0>} union { union { object {Panneau translate <2,0,0> rotate <20,-20,30>} object {Raccord} object {Bras translate <-1.5,0,0>} translate <3,0,0> rotate <0,25,-25> } union { object {Raccord} object {Bras translate <-1.5,0,0>} } translate <3,0,0> rotate <0,0,-20> translate <2,0,0> } } object {satellite scale 0.2 rotate <0,0,-30> translate <-6,-4,-2>} // soleil light_source { <60,20,150> color rgb <5,5,0> looks_like { sphere {<0,0,0>,10 texture { pigment {cylindrical rotate <90,0,0> scale 10 color_map { [0, color rgb <1,1,0>] [0.85 color rgb <1,1,0.5>] [1, color rgb <1,1,1>] }} } finish { ambient 1 } } } }