File: erosion1.scr

package info (click to toggle)
lg-issue18 5-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,928 kB
  • ctags: 148
  • sloc: makefile: 36; sh: 4
file content (21 lines) | stat: -rw-r--r-- 1,057 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# ========= Example Erosion script      ================
# --------- by John Beale Nov. 11/30/96 ----------------

gforge 200    ;# generate a random 200x200 surface
peak .5 .5    ;# position the highest point in the middle
fillbasin 100 ;# iteratively fill in lowest points, take 100 steps
flow          ;# generate a river-flow map using a downhill-flow algorithm
norm 0 0.1    ;# scale flow map to have value ranges in [0...0.1]
sub           ;# subtract this matrix from landscape
               # It is this subtraction which "carves out" the rivers
smooth 0.1    ;# smooth off edges a bit to simulate landslips, weathering

# Do all of this again. And again. And... eventually, it looks like something.
# (Once you've filled in the basins in the first step, you don't need to
#  refill them so much, and the algorithm is very slow. Should be improved.)

fillb 10; flow; norm 0 0.1; sub; smooth 0.1
fillb 10; flow; norm 0 0.1; sub; smooth 0.1
fillb 10; flow; norm 0 0.1; sub; smooth 0.1

# ========= end of erosion script =============================