Friday, May 29, 2020

Meander: a procedural system for generating maps of rivers that never existed

The underlying dynamics of this system are easy enough to understand: rivers pick up material and deposit it downstream, rivers erode the outer bank of a curve where the water speed is higher and deposit on the inner bank where the water speed is slower, and rivers can cut off meanders in favor of a straighter path which forms isolated sections called oxbow lakes.

To simulate this process with code, we can ignore erosion and deposition and just think of a curved line on a plane. Each point on the curve has a coordinate frame which is represented by three vectors: normal, tangent, and bitangent. Since we are dealing with a planar phenominon (ignoring changes in elevation for now), we can disregard the normal vector (in our case, the normal just points straight up) and just make use of the tangent and bitangent vectors. The tangent points in the direction of the line and the bitangent is at a right angle to the tangent.

One thing to note, the bitangent vector isn't enough to make our curve meander. A derived bitangent generally points to the same side of the line, whereas we need our bitangent to be aware of which way the line is curved. It should always point to the outside of the curve and its length should be proportional to the curvature of the line at that point. 

 



from Hacker News https://ift.tt/2AWpR87

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.