POV-Ray : Newsgroups : povray.advanced-users : Nightside lights : Re: Nightside lights Server Time
29 Jul 2024 08:15:43 EDT (-0400)
  Re: Nightside lights  
From: Ken
Date: 4 Sep 2002 22:12:06
Message: <3D76BE51.50BF521B@pacbell.net>
Rohan Bernett wrote:
> 
> I'm not sure if this question is advanced enough to post in this group, but
> anyway, here it is.
> 
> I'm making a model of the Earth to be seen from space. I've got textures for
> oceans, land, clouds, and "lights of civilization". What I want to do is,
> to make the lights only visible on the nightside of the Earth, and still be
> able to rotate the Earth by any amount, so you can see different areas of
> lights on the nightside, and different areas of land on the dayside. At the
> moment, the lights are visible on both sides of the Earth, so how do I make
> them be off on the dayside ond on on the nightside?
> 
> Hopefully someone will be able to help me with this problem.

I have no idea if this will work as expected but on the off chance...

Two spheres of equal size.

The first sphere with the daylight image. Intersect the sphere with a fixed plane
resulting with half a sphere - call it Left_Hemisphere

The second sphere with the night time image. Intersect the sphere with a fixed plane
resulting with half a sphere - call it Right_Hemisphere.

Now you have two half-spheres that look like one whole sphere.

Now if you rotate both image_maps the images will rotate into the intersection
and it will appear that you have one whole sphere rotating on screen with the day
and night side images where they belong. In actuality the spheres never rotate
because you are rotate the image maps instead.

e.g.

intersection {
   sphere { 0,.5 
     pigment {
       image_map { tga "day_image.tga" map_type 1 }
     rotate y*360*clock
    }
   }
  plane { x,0 }
}

intersection {
   sphere { 0,.5 
     pigment {
       image_map { tga "night_image.tga" map_type 1 }
     rotate y*360*clock
    }
   }
  plane { -x,0 }
}

Does any of this make sense?

-- 
Ken Tyler


Post a reply to this message

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