PDA

Click to See Complete Forum and Search --> : random terrain generation


r0ach
May 24th, 2000, 09:06 PM
I'm trying to generate a terrain on a 40 x 40 grid. There should be three mountains, which i'll color yellow, and then gradually change to white as the altitude decreases. Can someone please try and explain to me how I can do this. I read a whole lot of source code, but it's mostly Java or C++, and it is to do 3D terrains without grids.

kedaman
May 27th, 2000, 10:07 PM
ACtually terrain generating is a set of algoritms you should make yourself. To make a terrain just declare a byte or integer array.

Here's an example for the altitude:


For y=0 to 40
For x=0 to 40
terrain(x,y)=int(rnd*5+abs(20-y)/2)
next x
next y