POV-Ray : Newsgroups : povray.newusers : arrays and random numbers : Re: arrays and random numbers Server Time
5 Sep 2024 16:21:48 EDT (-0400)
  Re: arrays and random numbers  
From: Ken
Date: 8 Apr 2000 23:52:05
Message: <38EFFE89.1B16A047@pacbell.net>
CMcCabe wrote:
> 
> ok, after seeing the recent posts of Sphere and Superellipsoid world in
> the text.scene-files and binaries.images i tried to write something that
> i thought would produce a similiar effect
> upon trying to render it i came up with a message saying 'cannot assign
> uninitialized identifier'
> this error was produced when it got to this line:
> #declare CityArray[XPos][ZPos]=RNum;
> the RNum is declared on this line:
> #declare RNum = int ( rand ( seed(802) ) );
> 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
> 
> any help would be greatly appreciated
> CMcCabe

You need to pre-declare the seed value. It cannot be used directly inside
the rand statement.

#declare R = seed(802);

#declare RNum = int ( rand ( R ) );

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

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