POV-Ray : Newsgroups : povray.animations : Passing variables between iterations : Re: Passing variables between iterations Server Time
28 Jul 2024 12:34:30 EDT (-0400)
  Re: Passing variables between iterations  
From: Philippe Debar
Date: 8 Sep 2000 07:35:58
Message: <39b8cf1e@news.povray.org>
"Richard Brooks" <bro### [at] kmrllmitedu> wrote in message
news:39b7fab6@news.povray.org...
> How can I pass a variable between frames rendering iterations in POV?
>
> I'm running an 1800 frame animation, 30 frames per second, and I want a
> different random number every 6 seconds (180 frames).
>
> I created an array of 10 random numbers, and then used the clock to select
> the number from the array. This works, but is sloppy and not truely
random!
>
> Is there a way to pass a value from one frame to the next?

If the values where generated with rand(seed), can't re-generate them for
each frame?
Something like (from the top of my head and utterly untested) :

#declare aSeed=123;
#declare currentFrame=clock*1799;
#declare iterator=0;
#while (iterator=<currentFrame)
  #declare randomNumber=rand(aSeed);
  #declare iterator=iterator+180;
#end


Povingly,


Philippe


Post a reply to this message

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