Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / more terrain commands - randomize

Author
Message
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Jul 2004 09:20
Just for quick example, I used a standard matrix for this. It uses a fault formation method for settings heights. Quite simply, each iteration draws a random line across the matrix. All points to the left of the line are lowered, and to the right of the line are raised. Also, I have done a simple smoothing routine. It simply averages the heights of surrounding points.

Each key press equals 1 iteration.
space = fault formation pass
return = smoothing pass
shift = all random points (randomize matrix)

arrow keys/mouse to move and look around

"eureka" - Archimedes
jwurmz
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Arizona, USA
Posted: 1st Jul 2004 11:42 Edited at: 1st Jul 2004 18:13
[EDIT]
(please disregard this post, sorry)

"Creativity is knowing how to hide your sources" - Einstein
kenmo
22
Years of Service
User Offline
Joined: 7th Sep 2002
Location:
Posted: 1st Jul 2004 13:38 Edited at: 27th Jun 2012 06:03
Thats some damn fine code, Mr Phaelex. With a little bit of smoothing help from kenmo (just a lil)

Actually that really did turn out cool for less than a day of work. A few faults, 1 or 2 smooths, and thats some fine lookin terrain.

By the way, youre like me: http://www.dannywartnaby.co.uk/rgt/index.php?board=21;action=display;threadid=3927 - you used "simple" 3 times in your post.
jwurmz
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Arizona, USA
Posted: 1st Jul 2004 14:24
just a suggestion phaelax - instead of completely randomizing, just randomize up to a certain value above the initial matrix heights:



this way, it's sort of a "reverse smooth" that allows you to preserve the look, but randomize still.

"Creativity is knowing how to hide your sources" - Einstein
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Jul 2004 01:59
lol, yes, thx kenmo. I probably would've spent all daying trying to do a gaussian blur for smoothing. I think it could've been...simple.

"eureka" - Archimedes

Login to post a reply

Server time is: 2025-08-09 01:34:22
Your offset time is: 2025-08-09 01:34:22