|
![](/i/fill.gif) |
So I wanted to pseudorandomly place objects (with some minimum spacing)over
a 2 d field. The technique I was using for this amounted to :
k = min
while (k < max)
l = min
while (l < max)
dummy = rand(x);
if (dummy < 1/1000) & (dummy > 1/2000)
place the object (on average it would show up in 1 of every 2k
possible spots).
end
l = l+1
end
k = k+1
end
(yeah I know it's not real pov code, but...)
Anyways, it seemed that no matter what bounds I used, I was getting square
grids of objects (instead of the randomly placed ones I wanted). Upon
debugging, I found that (atleast to 5 decimal places) the values popped out
by a particular rand stream repeated (which is not what I had expected.
BTW, I'm doing this on a winXP machine, with pov version 3.5...
Any suggestions on how to get 'round this ? Anyone else come across this
before ? I guess I could create new random number streams, but I don't know
if that is necessarily the wisest move.
Thanks...
Post a reply to this message
|
![](/i/fill.gif) |