POV-Ray : Newsgroups : povray.animations : Passing variables between iterations : Re: Passing variables between iterations Server Time
28 Jul 2024 12:27:25 EDT (-0400)
  Re: Passing variables between iterations  
From: John VanSickle
Date: 8 Sep 2000 07:34:08
Message: <39B8CEB0.477C4A6B@erols.com>
Richard Brooks wrote:
> 
> 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).

// these two lines are to eliminate a potential FP rounding error
#declare Frame=floor(clock*30+.5); // 30 comes from the frame rate
#declare Clock=Frame/30;

#declare Seed=seed(floor(Clock/6));

#declare MyRandomValue=rand(Seed);

MyRandomValue will change every six seconds.

Hope this helps,
John


Post a reply to this message

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