A failed attempt at yielding rivers from gradient noise

From the jsfiddle here

I have done a previous post on gradient noise, explaining my realisation at why the equations involved are what they are.

Hydronics are notoriously challenging in procedural landscapes because very few realistic ontogenetic algorithms exist.

The solutions employed by the likes of dwarf fortress is to run calculations based on a path at different levels of detail down from the mountains to the oceans.

Given that gradient, noise is so-called because it makes use of gradients and from the simplicity with which beaches can be generated I wondered if a simple -1/a trick would yield path perpendicular to the beaches - a river?


The reasoning behind -1/a is that if you have a gradient on a graph, say “a” from a line ax+b, if you want a perpendicular line, then the gradient will be (-1/a).

Following this reasoning, and the fact that we have the gradient at each point, I attempted to calculate the negative inverse of the gradient, which ended up being fiendishly complicated and actually lead to me desiring the mathematical spellcheck.

As you can see from the image it doesn’t achieve anything approaching river looking.


Comments

Popular posts from this blog

Some thoughts on solving transcendental equations

Too whet an appetite for DRY principles