POV-Ray : Newsgroups : povray.newusers : sunlight & night + day Server Time
21 Nov 2024 08:07:40 EST (-0500)
  sunlight & night + day (Message 1 to 9 of 9)  
From: folkert
Subject: sunlight & night + day
Date: 26 Feb 2018 08:15:00
Message: <web.5a94073e29363f932733f2c00@news.povray.org>
Hi,

I'm using the following code to produce sun-light in a povray scene:

// distance: 150.000.000km, diameter 1.932.000km
//Declare variables so you won't have mysterious numbers all over your code:
#declare V_SUN = <3000, 3000, 3000>; //Not necessarily overhead.
#declare dSun = vlength (V_SUN) * (1390000/150000000);

light_source
{  V_SUN, color White
   area_light dSun * x, dSun * z, 5, 5 adaptive 1 jitter
   circular orient //Using this, the Sun doesn't have to be overhead.
   parallel point_at 0
   looks_like
   {  sphere
      {  0, dSun //Location is relative to the light_source, not the origin.
         pigment { color rgb <1, 1.0, 0.85> }
         //Give the Sun a glowing appearance:
         finish { diffuse 0 ambient 1 } //POV-Ray 3.6.
            //or
         finish { diffuse 0 ambient 0 emission 1 } //POV-Ray 3.7.
      }
   }
}

This works very well.

I'm now trying to simulate night and day. I thought I just could add a
rotate<clock, 0, 0> just before the last line and control that using +Ksomevalue
on the commandline (which works fine for rotating other objects). For this
sunlight it does not have any effect.
What am I doing wrong?


regards


Post a reply to this message

From: Bald Eagle
Subject: Re: sunlight & night + day
Date: 26 Feb 2018 09:00:00
Message: <web.5a941239886a35cbc437ac910@news.povray.org>
At a quick glance, I'm not sure what's wrong with that.

Also, are you aware of sunpos.inc?


Post a reply to this message

From: folkert
Subject: Re: sunlight & night + day
Date: 26 Feb 2018 16:15:00
Message: <web.5a9477c6886a35cb4cb5856e0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> At a quick glance, I'm not sure what's wrong with that.
>
> Also, are you aware of sunpos.inc?

Yes but it only calculates the position?


Post a reply to this message

From: Bald Eagle
Subject: Re: sunlight & night + day
Date: 26 Feb 2018 16:50:01
Message: <web.5a94806d886a35cbc437ac910@news.povray.org>
"folkert" <fol### [at] vanheusdencom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > At a quick glance, I'm not sure what's wrong with that.
> >
> > Also, are you aware of sunpos.inc?
>
> Yes but it only calculates the position?

Well, yes, but if you change the "time" with the clock value, then the sun goes
around...

http://news.povray.org/povray.binaries.animations/thread/%3Cweb.584ff182dc625f27c437ac910%40news.povray.org%3E/


Post a reply to this message

From: Kenneth
Subject: Re: sunlight & night + day
Date: 26 Feb 2018 17:10:01
Message: <web.5a94853d886a35cba47873e10@news.povray.org>
I put a simple box object into a scene to check the effect, with my camera near
the origin. Try using a backwards rotation-- I do see the changing light effect
then.

Like,  +K-30 on the command line.



           ....
          finish { diffuse 0 ambient 1 } //POV-Ray 3.6.
             //or
          finish { diffuse 0 ambient 0 emission 1 } //POV-Ray 3.7.
       }
    }
       rotate <clock,0,0>
 }

I do notice that, past some some positive rotation angle, the light looks like
it disappears(?). Maybe the Sun is moving below the horizon, based on V_SUN's
original position?


Post a reply to this message

From: Kenneth
Subject: Re: sunlight & night + day
Date: 27 Feb 2018 18:50:01
Message: <web.5a95ee01886a35cba47873e10@news.povray.org>
By the way, your looks_like sphere seems to be HUGE-- almost like a sky_sphere.
Its radius is scaled up by d_sun. Did you mean to do that?
>     looks_like{
>    {  sphere
>       {  0, dSun //Location is relative to the light_source, not the origin.
>          pigment { color rgb <1, 1.0, 0.85> }
>          //Give the Sun a glowing appearance:
>          finish { diffuse 0 ambient 1 } //POV-Ray 3.6.
>             //or
>          finish { diffuse 0 ambient 0 emission 1 } //POV-Ray 3.7.

Maybe that's causing the problem. I would suggest something like...
looks_like{sphere{0, --some other smaller radius?---
(or maybe some fraction of d_sun)


Post a reply to this message

From: folkert
Subject: Re: sunlight & night + day
Date: 1 Mar 2018 05:00:01
Message: <web.5a97cea4886a35cb2733f2c00@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> By the way, your looks_like sphere seems to be HUGE-- almost like a sky_sphere.
> Its radius is scaled up by d_sun. Did you mean to do that?

Yes :-)
I wanted it to be as real as the real sun.

> >     looks_like{
> >    {  sphere
> >       {  0, dSun //Location is relative to the light_source, not the origin.
> >          pigment { color rgb <1, 1.0, 0.85> }
> >          //Give the Sun a glowing appearance:
> >          finish { diffuse 0 ambient 1 } //POV-Ray 3.6.
> >             //or
> >          finish { diffuse 0 ambient 0 emission 1 } //POV-Ray 3.7.
>
> Maybe that's causing the problem. I would suggest something like...
> looks_like{sphere{0, --some other smaller radius?---
> (or maybe some fraction of d_sun)

Hmmm but with the experiment you did it worked fine? The one with the box.


Post a reply to this message

From: folkert
Subject: Re: sunlight & night + day
Date: 1 Mar 2018 05:10:01
Message: <web.5a97d0b2886a35cb2733f2c00@news.povray.org>
I suddenly realised what the issue is: the sun does rotate but...there's a
sky_sphere as well. So it always looks like day-time.


Post a reply to this message

From: Kenneth
Subject: Re: sunlight & night + day
Date: 2 Mar 2018 18:55:01
Message: <web.5a99e419886a35cba47873e10@news.povray.org>
"folkert" <fol### [at] vanheusdencom> wrote:
> I suddenly realised what the issue is: the sun does rotate but...there's a
> sky_sphere as well. So it always looks like day-time.

Glad you worked it out.

Sorry, I misread your dsun equation, thinking it was a HUGE value (which got me
off-track.) But it's only 48.15 units, with the resulting looks_like sphere
positioned at your light source at <3000,3000,3000>.

My box experiment showed only the shadow effects FROM your light source, onto a
plane; I didn't think to aim the camera *at* your Sun, to see its visible sphere
shape.


Post a reply to this message

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