|
|
Kenneth wrote:
> In other words, as frame_number progresses linearly, then seed(frame_number)
> will start showing patterns quite quickly *from frame to frame.* Again, only IF
> one rand() value is called per frame (or so it seems.)
If you have a known number of random numbers being used in each frame, you
can seed once at frame 0, then on each subsequent frame, generate
frame_number time known_random_number_count random numbers, and then pick up
the stream from there. Use a while loop in SDL to generate calls to rand(),
in other words.
There's no good reason to believe the first number you generate after
seeding the RNG looks especially random for different seeds. It's the
consecutive numbers from the same seed that are pseudo-random.
--
Darren New, San Diego CA, USA (PST)
There's no CD like OCD, there's no CD I knoooow!
Post a reply to this message
|
|