POV-Ray : Newsgroups : povray.windows : Can POV SDL read system time? : Re: Can POV SDL read system time? Server Time
28 Sep 2024 18:09:39 EDT (-0400)
  Re: Can POV SDL read system time?  
From: Mike Williams
Date: 24 Apr 2004 04:45:26
Message: <fk4LXAAUjiiAFwqB@econym.demon.co.uk>
Wasn't it Nicolas Alvarez who wrote:
>I saw (I don't remember where) that this will be available in future versions of
>POV-Ray.
>
>Reading system clock would be also useful in sunpos.inc (that returns the
>position of the sun, for a given date, time, and location on earth). It would be
>useful to use actual time rather than changing parameters on each render
>(briefly, I have the same problem as you).

The date() facility is available in the unofficial MegaPOV. This returns
various components of the date and time as a string. If you need to
perform arithmetic on the date/time information, then you'll need to
convert the individual components to floats, something like this:

#version unofficial megapov 1.0;        // Needed for date()

#include "strings.inc"                  // Needed for Parse_String

#declare Hours = date("%H");            // Get time component strings
#declare Mins  = date("%M");
#declare Secs  = date("%S");

#declare H = Parse_String(Hours);       // Convert strings to floats
#declare M = Parse_String(Mins);
#declare S = Parse_String(Secs);

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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