POV-Ray : Newsgroups : povray.general : Steps & Time : Re: Steps & Time Server Time
28 Jul 2024 20:32:46 EDT (-0400)
  Re: Steps & Time  
From: Alain
Date: 7 Aug 2007 05:57:21
Message: <46b84201$1@news.povray.org>
Simon nous apporta ses lumieres en ce 2007/08/07 04:24:
> Hi all,
> 
> wonder if someone can suggest some methods for dealing with this:
> 
> Currently: Whenever I want to have multiple steps in a scene, I do something 
> like the following:
> 
> #declare Steps = 10;
> #declare Step = floor(Steps*clock);
> #declare Clock = mod(clock*Steps,1);
> 
> #if(Step=0)
>     //Some rules for step 0 of the animation
> #else
>     //Some rules for after step 0, usually keeping an object stable
> #end
> 
> As you can imagine, this becomes cumbersome very quickly if an object is 
> doing different things in each step - and it means a lot of nested IFs. In 
> the demo above, the steps are all of even Length, but that is easily 
> resolved with a bit of logic and an array.
> 
> An alternative that sprang to mind was just to copy/paste into multiple 
> scenes but that means that if I decide to change something in a previous, I 
> have to propogate my changes up and down the timeline - also cumbersome.
> 
> Any pointers would be greatly appreciated
> 
> (whilst writing this I realised there should be a switch statement of some 
> kind and *tada* there is - but still, if anyone has any suggestions, please 
> let me know) 
> 
> 
Take a look at the #switch(...) #case(...) #range(...) #break structure.
3.2.2.6.3  The #switch, #case, #range and #break Directives


-- 
Alain
-------------------------------------------------
  My bologna has a first name.

                    Oscar Mayer


Post a reply to this message

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