Results 1 to 2 of 2

Thread: random terrain generation

  1. #1

    Thread Starter
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722
    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.

    r0ach™
    Don't forget to rate the post

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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:

    Code:
    For y=0 to 40
     For x=0 to 40
      terrain(x,y)=int(rnd*5+abs(20-y)/2)
     next x
    next y
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width