|
 |
Mike Horvath <mik### [at] gmail com> 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
|
 |