POV-Ray : Newsgroups : povray.animations : using sunpos.inc to create sunset : using sunpos.inc to create sunset Server Time
28 Jul 2024 08:34:59 EDT (-0400)
  using sunpos.inc to create sunset  
From: Børge Berg-Olsen
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

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