POV-Ray : Newsgroups : povray.general : Clock intervals : Re: Clock intervals Server Time
16 Apr 2024 05:24:09 EDT (-0400)
  Re: Clock intervals  
From: Bald Eagle
Date: 17 Jul 2018 18:15:00
Message: <web.5b4e693829c714e5458c7afe0@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> I want to be able to tie a variable to the clock value, but only for
> certain portions.
>
> For example, the variable should be equal to 0 before the clock is 0.3,
> and equal to one after the clock is equal to 0.6. In between 0.3 and 0.6
> the clock should interpolate from 0 to 1.
>
> How would I do this using a macro? Thanks.
>
>
> Mike

#version 3.7;
global_settings {assumed_gamma 1.0}


#declare epsilon = 1e-6;
#declare Frames = 100;

#for (N, 1, Frames)

#switch (N)

#range (0, 0.3)
 #declare Clock = 0;
#break

#range (0.3, 0.6)
 #declare Clock = (n-0.3)*(1/0.3);
#break

#range (0.6, 1.0)
 #declare Clock = 1;
#break

#else
// Do nothing
#end // end switch - case/range - break

#debug concat ("Variable = ", str (Clock, 1, 3), "\n")

#end


Post a reply to this message

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