[MUD-Dev] Rooms, 3D arrays, etc.

Miroslav Silovic silovic at srce.hr
Thu May 29 11:22:16 CEST 1997


> [Miro:]
> 
> :Use pseudorandom function. Here's one I use to generate procedural
> :textures in my renderer:
> 
> [code omitted]
> 
> Call me dumb, but I'm not understanding your solution. I see what the
> code does, but I don't see how it fits in. Where do the parameters to
> 'irand' come from, i.e. what are they, and how do they relate to the
> x,y coordinates and the stored random seeds used to tweak the landscape?
> 

Uuuh, sorry. I forgot that my code is obvious... to me. :)
Here's an example call:

int i[2];

i[0] = x;
i[1] = y;
terrain.elevation = (int)(150*irand(2, i));


(of course, the last is not quite honest, since you need to substitute that
line with fractal noise generator. Look into my renderer at
ftp://maja.zesio.fer.hr/pub/tools/graphics/sart)

Another notice, irand works with n-dimensional noise fields. The first
parameter is the number of dimensions (you want 2), and the other is
pointer to the vector of integer coordinates. Hope this helps. :)

	Miro




More information about the mud-dev-archive mailing list