POV-Ray : Newsgroups : povray.general : problem: repeating rand patterns using seed in animation : Re: problem: repeating rand patterns using seed in animation Server Time
30 Jul 2024 12:20:30 EDT (-0400)
  Re: problem: repeating rand patterns using seed in animation  
From: Chris B
Date: 23 Jan 2009 17:51:41
Message: <497a49fd$1@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote in message 
news:web.497a1e5215dcf5ebf50167bc0@news.povray.org...
> I've run into an interesting and totally unexpected situation in v3.6.1 
> while
> animating, trying to produce some random values from frame to frame. I'm 
> seeing
> repeating patterns in the values; nothing that I try eliminates them.
> ... snip ...
> So, practically speaking: How do I get *obviously* random values in 
> animation,
> across frames? I'm stuck. Trying different schemes to vary seed hasn't 
> worked so
> far (although I haven't exhausted the idea yet.)

You could try using the same seed in each frame, using the frame_number or a 
multiple of it to step through to a fresh part of the pseudo random sequence 
. The following example throws away one for each frame that's gone before. 
If you use 10 in a frame you could loop 10 times as far through the stream.

#declare P = seed(1);
#local I = 0;
#while (I<frame_number)
  #local ThrowAway = rand(P);
#end


Post a reply to this message

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