POV-Ray : Newsgroups : povray.advanced-users : Nightside lights : Re: Nightside lights Server Time
29 Jul 2024 08:17:48 EDT (-0400)
  Re: Nightside lights  
From: Gilles Tran
Date: 5 Sep 2002 07:32:32
Message: <3d7740d0$1@news.povray.org>

web.3d76afc2d9d2c03118ccf4f70@news.povray.org...
> I'm making a model of the Earth to be seen from space.

I did the following not so long ago. You'll have to adapt it to make it work
but that's the idea.

G.

// ----------------------------------------
// Main light
// ----------------------------------------
#declare RotaZ=30; // main light rotation
#declare RotaY=-20;
#declare colBackLight= rgb galaxy_colour2;
#declare colBackLight= GammaColor(galaxy_colour2,0.5);


// ----------------------------------------
// Earth
// ----------------------------------------
// The day map and the night map are set to the current light rotation !!!


#declare RotaAxis=-80; // earth rotation
    #declare txtDay=texture{
        pigment{
            image_map{jpeg "earth_day2" map_type 1}
        }
        finish{ambient 0.3 diffuse 1}
        rotate y*RotaAxis
    }
    #declare txtNight=texture{
        pigment{
            image_map{jpeg "earth_night2" map_type 1}
        }
        finish{ambient 1 diffuse 0}
        rotate y*RotaAxis
    }
    #declare Earth=union{
        sphere{0,1
            texture{
                pigment_pattern{
                    gradient x
                    scale 2
                    translate -x
                    rotate z*RotaZ
                    rotate y*RotaY
                }
                texture_map{
                    [0.45 txtNight]
                    [0.55 txtDay]


                }
            }


        }

        sphere{0,1
            hollow
            texture{
                pigment{
                    pigment_pattern{
                        image_map{jpeg "clouds_2000" map_type 1}
                    }
                    color_map{
                        [0 Clear]
                        [1 White]
                    }
                    rotate y*RotaAxis
                }

                finish{ambient 0.1 diffuse 2}
            }
            scale 1.01
        }

        sphere{0,1
            hollow
            texture{
                pigment{Clear}
                finish{ambient 0 diffuse 0}
            }
            interior{
                media{
                    emission galaxy_colour2*4
                    density{
                        spherical
                    }
                }
            }
            scale 1.1
        }


    }

light_group{
    light_source{<-5,0.5,-3> colBackLight*0.2}
    object{Earth}
    global_lights on
}


--

**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.