POV-Ray : Newsgroups : povray.animations : using sunpos.inc to create sunset Server Time
28 Jul 2024 10:14:06 EDT (-0400)
  using sunpos.inc to create sunset (Message 1 to 4 of 4)  
From: Børge Berg-Olsen
Subject: using sunpos.inc to create sunset
Date: 21 Oct 2001 11:30:55
Message: <3BD2EA2F.EF9444E@dod.no>
Hi all,

First, I hope this is the correct group to be asking these questions,
second I hope I can get some help. ;-)

I've been creating an animation of the sun's position at my hometown for
a certain date. I have the concept proofed and it works. Now I wanted to
create a larger animation calculation the position of the sun every 1
minute for 24 hours. 

#include "sunpos.inc"
#declare _clock = clock;
#declare Year= 2001;
#declare Month= 6; //+ int (_clock*12);
#declare Day= 21; //+ int(_clock*365);
#declare Hour= 00 + int(_clock*24);
#declare Minute= 00 + int (_clock*60);
#declare Lstm= 15;
#declare LAT= 69.8;
#declare LONG= 16.2;

light_source {
   SunPos(Year, Month, Day, Hour, Minute, Lstm, LAT, LONG)
   rgb 1
}

If I use the above, and create an animation with 1440 + 1 frames I
should get a perfect cyclic animation. However, what this do is to
create 1440 frames, calculation the position of the sun from 00:00 to
01:00. not what I intended.

I can use:

#declare Hour= 00; //+ int(_clock*24);
#declare Minute= 00 + int (_clock*60);

Trace 60 frames, save them in a different folder, then do:

#declare Hour= 01 + int(_clock*24);
#declare Minute= 00 + int (_clock*60);

And repeat ad nauseum, until the sun have gone a full circle. Then
compile all the frames and have what I want, but it's too cumbersome.
Especially if you want to automate the proceess and forget it until it's
finished.

So, my question is: Is there a way to make the input to the SunPos macro
become something like

SunPos (2001, 6, 21, 00, 00, 15, 69.8, 16.2)
SunPos (2001, 6, 21, 00, 01, 15, 69.8, 16.2)
SunPos (2001, 6, 21, 00, 02, 15, 69.8, 16.2)
.
.
.
SunPos (2001, 6, 21, 00, 59, 15, 69.8, 16.2)
SunPos (2001, 6, 21, 01, 01, 15, 69.8, 16.2)
SunPos (2001, 6, 21, 01, 02, 15, 69.8, 16.2)
SunPos (2001, 6, 21, 01, 03, 15, 69.8, 16.2)
.
.
.
SunPos (2001, 6, 21, 23, 59, 15, 69.8, 16.2)
SunPos (2001, 6, 21, 00, 00, 15, 69.8, 16.2)

I am guessing creating a parametric file with the values needed, and
then have povray read that parametric file into an array and then do the
calculation would be the best, but I would really, really like to know
if there is a way to create it automatically.

Thanks for any help!

Warmest regards,

--

------------------------------------------------------------------------

  azo### [at] dodno, Ducati M600, Clementine  Ubesudlet: Aldri eid en J&%#PS


Post a reply to this message

From: ingo
Subject: Re: using sunpos.inc to create sunset
Date: 21 Oct 2001 13:39:30
Message: <Xns9141C7F97A4C1seed7@povray.org>


> #declare Minute= 00 + int (_clock*60);
> 

Try:

 #declare Minute= 00 + int (_clock*1440);

and forget the hours etc.

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Børge Berg-Olsen
Subject: Re: using sunpos.inc to create sunset
Date: 22 Oct 2001 08:27:23
Message: <3BD410AB.9006FF@dod.no>
ingo wrote:
> 

> 
> > #declare Minute= 00 + int (_clock*60);
> >
> 
> Try:
> 
>  #declare Minute= 00 + int (_clock*1440);
> 
> and forget the hours etc.

Uuuh, do I feel sheepish now?! At least my head hurts from not seeing
the obvious before. I must have been tired, or something. Yeah, that's
it. Tired. :-)

Thanks for the help, now it works as I wanted it too.

--

------------------------------------------------------------------------

  azo### [at] dodno, Ducati M600, Clementine  Ubesudlet: Aldri eid en J&%#PS


Post a reply to this message

From: davidafisher
Subject: Re: using sunpos.inc to create sunset
Date: 31 Oct 2002 12:15:05
Message: <web.3dc163d2fea7cd5967ebf1b60@news.povray.org>
I tired out this routine with the light source set as

light_source {
              <0,0,0>      //0*x light's position starts at the origin
              color White  // light's color
              translate SunPos(Year, Month, Day, Hour, Minute, Lstm, LAT,
LONG);
}

and placing a sun in the sky by using skysphere as:

sky_sphere {
            pigment {gradient y
            color_map {[0.0 radians(0.03333) color Yellow   //for the sun
disk                                        color Yellow]
                       [radians(0.03333) (1-cos(radians(Al)))/2 color Blue
                                                                color Blue]
                       [(1-cos(radians(90-Al)))/2 color rgb<0.0,0.0,0.6156>]
                      }
            scale 2
            translate -1
           }
    //clouds
           pigment { etc etc.......

It works fine except as soon as the center of the light source hits the
horizon the whole light source and sun disk disappear!

What do I need to do to continue to see the parts of the sun that remain
above the horizon until it completely disappears (or appears for sunrise)?

david


Post a reply to this message

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