POV-Ray : Newsgroups : povray.animations : Animation Control (time frames I Guess) : Re: Animation Control (time frames I Guess) Server Time
29 Jun 2024 08:42:13 EDT (-0400)
  Re: Animation Control (time frames I Guess)  
From: Marc Champagne
Date: 14 Sep 2003 07:09:09
Message: <Xns93F6485B1CEA6POVMIKA@204.213.191.226>
"Hughes, B." <omn### [at] charternet> wrote in
news:3f641cb8$1@news.povray.org: 

>> "Marc Champagne" <marcch.AT.videotron.DOT.ca> wrote in
>> message news:Xns### [at] 204213191226...
>>
>> During an animation sequence, if an object is to:
>>
>>     do something for 2 seconds
>>     stay idle for 3 seconds
>>     do something for 3 seconds
>>
>> Assuming:
>>
>>     +kff???
>>     +ki0 (default)
>>     +kf1 (default)
>>     And that we encode the final animation at 25 fps.
>>
>> Would one use something like this to figure out where in
>> time we are?
>>
>> #declare T = frame_number / 25 ;
>>
>> #if ( T<2 | ( T>5 & T<8 ) )
>>     do something
>> #end

> Seems okay to me. There's #range, used in #switch
> directive, that I might use for this kind of purpose too.
> Goes like so: 
> 
> #switch (T)
> #range (0,2)
> /* do first thing */
> #break
> #range (5,8)
> /* do second thing */
> #break
> #end
> 
> Except this wouldn't prevent the exact values 2, 5 and 8
> from being taken into account;

For (#range) the docs say:

  If Low_Value <= Switch_Value and Switch_Value<=High_Value
  then the condition is true. 

I havn't tried #range directive yet, maybe there is a bug
that i'm not aware of? 

> unlike your #if directive method, which I'd say is
> perfectly fine in that particular example. You just don't
> need the parenthesis around T>5&T<8 for it to work right, I
> believe. 

The parenthesis just makes things absolutely "clear", I never
liked relying on precedence. 

Thanks

-- 
Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA


Post a reply to this message

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