POV-Ray : Newsgroups : povray.binaries.images : Planet Earth : Re: Planet Earth Server Time
7 Aug 2024 11:20:02 EDT (-0400)
  Re: Planet Earth  
From: Trevor G Quayle
Date: 29 May 2006 21:46:27
Message: <447ba3f3$1@news.povray.org>
"Sven Littkowski" <sve### [at] jamaica-focuscom> wrote in message 
news:447b250a@news.povray.org...
> Planet Earth, latest version. Atmosphere, 3D clouds, 3D continents, 
> lights. Question: how to limit lights to only the nightside? Sven
>

Try playing with this and adapt it to your needs.  It basically uses the 
object pattern with a plane oriented to the direction of the sun.  Inside 
the plane (away from the sun) the Earth light image map is used, outside the 
plane (toward the sun) the texture is transparent.

//start
global_settings {
  assumed_gamma 1
  max_trace_level 10 }

camera{
  up y
  right x*image_width/image_height
  angle 60
  location <30,30,30>
  look_at  0
}

#local SunLoc= <-500,0,100>; //Sun location

light_source { SunLoc rgb 1 } //Sun

sphere{0 9.9999 //planet below
  pigment {rgb <0,0,1>}
  finish {ambient 0 diffuse 1}
}

#local Lights=
texture{
  pigment {image_map {png "Earth_Lights.png" interpolate 4 map_type 1}}
  finish {ambient 4 diffuse 0}
}


#local NoLights=
texture{
  pigment {rgbt 1}
  finish {ambient 1 diffuse 0}
}


#local OBJ=plane {SunLoc 0}

sphere{0 10
  texture {
    object{
      OBJ
      texture{NoLights}
      texture{Lights}
    }
  }
}
//end

-tgq


Post a reply to this message

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