POV-Ray : Newsgroups : povray.general : Dumb clock animation question : Re: Dumb clock animation question Server Time
17 Apr 2024 21:23:47 EDT (-0400)
  Re: Dumb clock animation question  
From: JimT
Date: 18 Feb 2019 12:40:05
Message: <web.5c6aed9530cdf982c97227110@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> On 2/17/2019 7:27 AM, Tor Olav Kristensen wrote:
> > #macro MacroName(StartTime, EndTime)
> >
> >      #local R = (clock - StartTime)/(EndTime - StartTime);
> >      #local S = min(max(0, R), 1);
> >
> >      S
> >
> > #end // macro MacroName
>
>
> Thank you! That's perfect.
>
>
> Mike

I hesitate to try to improve on a TOK solution, but in my animations, a very
early line will be

#declare MyTime = clock;

then I use MyTime wherever I would use clock. This lets me #declare MyTime =
0.6667, for example to go to a position in the animation to test a particular
stage without running the whole animations. You would pass MyTime to the #macro.
This may be obvious, but it is an improvement.


Post a reply to this message

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