                                /*
; Persistence Of Vision raytracer version 3.5 sample file.

Antialias=on

Antialias_Threshold=0.2
Antialias_Depth=3
Input_File_Name=eclipser_monthly_2005.pov

Output_File_Name=eclipser_monthly

Initial_Frame=1
Final_Frame=180
Initial_Clock=0
Final_Clock=1

Cyclic_Animation=on
Pause_when_Done=off

+
*/
#include "colors.inc"
#include "stars.inc"


global_settings {
  assumed_gamma 1.0
  ambient_light color rgb <1,.8,.7>*.7
}

#declare lclock = clock -.0;
#declare omega_earth_rotate = -20;
#declare omega_ems_rotate =-6;
#declare rm=1;  // radius of moon's orbit
#declare reo=3; // radius of earth's orbit
#declare tilt=0; // tilt of moon's orbital plane (was 12) now zero for monthly eclipses
#declare msize= .1*rm; // moon's size
#declare esize= 2*msize; // moon's size
#declare ssize= msize*reo/rm; // moon's size
camera {
  location  <0.0, 1.3, -4.0>*reo*1
  look_at   <0.0, 0.0,  0.0>
  right     x*image_width/image_height
  angle 38
}


#declare earth = sphere { 0, 1
     texture { 
          pigment {
               image_map {
                    jpeg "land_ocean_ice_2048.jpg" 
                    map_type 1        
                    interpolate 4     
               } 
          }
          finish{  ambient .0125 diffuse .8}
          normal {
               bump_map { 
                    tiff "etopo-land.tif.tiff"  
                    map_type 1        
                    interpolate 4     
                    bump_size 5     
               } 
          }
     }
     texture{
          pigment {
               image_map {
                    jpeg "cloud_combined_2048.jpg" // the file to read (iff/tga/gif/png/jpeg/tiff/sys)
                    map_type 1        // 0=planar, 1=spherical, 2=cylindrical, 5=torus
                    interpolate 4     // 0=none, 1=linear, 2=bilinear, 4=normalized distance
                    transmit all 0.4      // N=all or color index # (0...N), V= value (0.0...1.0)
               } // image_map
          }
          finish{  ambient .05 diffuse 2.4}
     }
}
#declare sun = union{
     sphere{0,1 
          pigment{color rgb <1,1,.2>} 
          finish{ambient 2 diffuse 0}
          no_shadow }
     sphere {0, 1.2
         pigment{color rgbf <1,1,1,1>}
         texture {pigment {color rgbf 1}}
         hollow
         interior {
             media {
                 emission color rgb < 1, 1, .2>
                 scattering {5}
                 intervals 2 samples 4
                 method 3
                 aa_threshold 0.3 aa_level 2
                 density {spherical scale 1.8 }
             }
         }
     }                                             
     scale ssize
}

#declare moon = sphere { 0, 1
     texture { 
          pigment {
               image_map {
                    jpeg "moonalbedo.cont.jpg" 
                    map_type 1        
                    interpolate 4     
               } 
          }
          finish{  ambient .05 diffuse 1.4}
          
          normal {
               bump_map { 
                    jpeg "moon_topog2.jpg"  
                    map_type 1        
                    interpolate 4     
                    bump_size 2.5     
               } 
          }
           rotate 90*y
     }
     scale 1.0
}

declare ems = union{ //earth-moon system with decorations
     object{earth scale esize}
     object{moon scale msize translate -z*rm}
     torus { rm, 0.02 
          pigment { color rgb .5*<.4,.4,1>}  
          finish {ambient 3.0 diffuse 0.0 }
          no_shadow no_reflection
     }
     rotate omega_ems_rotate*360*lclock*y rotate tilt*z
}        
declare solar_sys=union{  //solar system
        object{sun}
        object{ems translate reo*(z*cos(-lclock*2*pi)+x*sin(-lclock*2*pi))}
        torus { reo, 0.02 pigment { color rgb .3*<.1,.4,.1>} //earth's orbit
                finish {ambient 3 diffuse 0.0 }
                no_shadow no_reflection
         }
}


object{solar_sys rotate -5*x }
light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1,.8,.7>*.7  // light's color
}

