|
![](/i/fill.gif) |
In article <38EFE55D.ADB3B7E5@fcmail.com>, CMcCabe
<dea### [at] fcmail com> wrote:
> i'm sort of assuming that i have something wrong with the way i'm using
> the random number generator, but i'm not entirely sure
> basically i'm trying to assign a random value to that position of the
> array
As Ken explained, you need to pre-declare the seed:
#declare RS = seed(802);
#declare RNum = int(rand(RS));
However, if this is the code you are using, I think you will be running
into another problem. The int() function operates like this(quoted from
the manual):
"int(A)
Integer part of A. Returns the truncated integer part of A. Rounds
towards zero."
Since the rand() function returns float values between 0 and 1
inclusively, you will get 0 most of the time, maybe all of the time. You
need to at least include a multiplier in there:
#declare RNum = int(rand(RS)*Mult);
where Mult>1.
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
![](/i/fill.gif) |