|
|
|
|
|
by chengsun
4397 days ago
|
|
The trick is to perform damping around the edges in a hidden border around the heightmap.
Say you wanted to simulate a 500x500 heightmap. You would actually calculate the results for a 700x700 heightmap, (which contains a hidden border of width 100 around each edge). The hidden edges are slowly damped away by multiplying by a factor interpolated between 1 (on the inner edge of the visible part of the heightmap) 0 (on the very outside of the heightmap). This works remarkably well; you can see this approach in action in http://www.falstad.com/ripple/ for instance. Source code is included on the page. |
|