Kenneth <kdw### [at] earthlink net> wrote:
> 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.
POV-Ray uses a linear congruential generator as RNG, and those tend to
produce patterns in certain situations.
What you can do to get a more random sequence is this:
1) On the first frame seed the RNG with whatever value (eg. 0).
2) Then pull a value with rand(), multiply it by a large value and
#write it to a file. Then use the value in your scene in any way
you want.
3) In subsequent frames #read that value from the file and give it to seed()
4) Repeat the steps 2 and 3.
--
- Warp
Post a reply to this message
|