POV-Ray : Newsgroups : povray.general : Steps & Time : Re: Steps & Time Server Time
28 Jul 2024 20:22:50 EDT (-0400)
  Re: Steps & Time  
From: Simon
Date: 7 Aug 2007 15:25:46
Message: <46b8c73a$1@news.povray.org>
"Alain" <ele### [at] netscapenet> wrote in message 
news: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

Alain, many thanks! I must admit I never realised how flexible the switch 
statement was! This definitely seems to be the way to go (although I'll also 
be looking into Chris's ideas).

I just want to thank you both for your advice.

Regards,
S


Post a reply to this message

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