#include "colors.inc" #include "stars.inc" #include "screen.inc" global_settings { assumed_gamma 1.0 } #declare framepertime = 90;//need this, ini values are not passed! // frequencies are in rotations per unit time #declare omega_earth_rotate = -5*360; #declare omega_mars_rotate = -4*360; #declare reo=1; // radius of earth's orbit #declare rmo=1.52*reo; // radius of mars' orbit #declare omega_earth_orbit = 1; #declare omega_mars_orbit = omega_earth_orbit*pow((reo/rmo),1.5);//ala kepler #declare ssize=.06*reo; // sun radius #declare esize=.6*ssize; // earth radius #declare msize=1*esize; // mars radius #declare phaser = function(time,f,delta) { (time*f+delta)*2*pi } #declare t_offset = -.5;// initial time phase relative to retrograde #declare localtime=clock+ t_offset; #declare epx = reo*cos(phaser(localtime,omega_earth_orbit,0)); #declare epz = reo*sin(phaser(localtime,omega_earth_orbit,0)); #declare mpx = rmo*cos(phaser(localtime,omega_mars_orbit,0)); #declare mpz = rmo*sin(phaser(localtime,omega_mars_orbit,0)); #macro Make_Earth (tt) sphere {0,1 //basic earth, possibly transparant texture { pigment { agate color_map { [0.0 color rgbt <.05,.05,.4,tt> ] [0.4 color rgbt <.2,.1,.1,tt> ] [1.2 color rgbt <.7,.7,.7,tt> ] } turbulence .3 } finish { ambient 1.0 diffuse 0.0 } } scale esize } #end #macro Make_Mars (tt) sphere {0,1 //basic mars, possibly transparant texture { pigment { agate color_map { [0.0 color rgbt <.2,.1,.05,tt> ] [0.4 color rgbt <.2,.15,.10,tt> ] [1.2 color rgbt <.1,.08,.05,tt> ] } turbulence .7 } finish { ambient 1.0 diffuse 0.0 } }texture { pigment { cylindrical color_map { [0.0 color rgbt <.2,.15,.10,1> ] [.78 color rgbt <.4,.4,.4,tt> ] [.80 color rgbt <.9,.9,.9,tt> ] } turbulence .1 } finish { ambient 1.0 diffuse 0.0 } } scale msize } #end #declare sun = sphere {0,ssize //sun texture { pigment { color rgb <.8,.8,0>} finish { ambient 1.0 diffuse 0.0 } } } #declare solarsys1 = union{ object{sun scale 1.5} object{ Make_Earth (0) rotate y*omega_earth_rotate*localtime scale 2 translate (epz*z+epx*x) } object{ Make_Mars (0) rotate y*omega_mars_rotate*localtime scale 2 translate (mpz*z+mpx*x) } box { //background for inset #declare btop = 1.1*ssize; #declare bside = 1.2*rmo; <-bside, -btop, -bside>, pigment { color rgb .1*<.1,.1,.1>} finish {ambient 1.0 diffuse 0.0 } } } #declare solarsys2 = union{ object{sun} object{ Make_Mars (0) rotate y*omega_mars_rotate*localtime translate (mpz*z+mpx*x) } //make ghosts for trail #declare nghostmax=5; #declare step = 5; #declare i=1; #declare nghost=min(frame_number/step,nghostmax); #while(i <= nghost) #declare fframe = (int(frame_number/step)-i+1)*step; #declare ftime = (fframe-1)/framepertime+t_offset; #declare mpxg = rmo*cos(phaser(ftime,omega_mars_orbit,0)); #declare mpzg = rmo*sin(phaser(ftime,omega_mars_orbit,0)); object{ Make_Mars (i/nghost) rotate y*omega_mars_rotate*ftime translate (mpzg*z+mpxg*x) } #declare i=i+1; #end } object{ solarsys2 } Set_Camera_Location(epz*z+epx*x) Set_Camera_Look_At(mpz*z+mpx*x-1.2*msize*y) Set_Camera_Angle(75) Screen_Object ( object{solarsys1 scale 3.68 rotate -90*x translate 4*(5*z+2.6*x-1.4*y) }, <0,.00>, .0, false ,1) sky_sphere { pigment { granite color_map { [ 0.000 0.270 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ] [ 0.270 0.280 color rgb <.5,.5,.4> color rgb <.8,.8,.4> ] [ 0.280 0.470 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ] [ 0.470 0.480 color rgb <.4,.4,.5> color rgb <.4,.4,.8> ] [ 0.480 0.680 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ] [ 0.680 0.690 color rgb <.5,.4,.4> color rgb <.8,.4,.4> ] [ 0.690 0.880 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ] [ 0.880 0.890 color rgb <.5,.5,.5> color rgb < 1, 1, 1> ] [ 0.890 1.000 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ] } turbulence 4 sine_wave scale 1.5 rotate x*30 } //finish { diffuse 0 ambient 1 } }