View Full Version : Rivers using Heirarchical Poisson Disc and Delaunay Triangulation

Hai-Etlik

04-26-2014, 02:53 AM

Here's what happens when you take a hierarchical Poisson disc stipple field, assign a rainfall level of 0 or 1 based on rank in the field and a precipitation surface (in this case (sin x*cos y)^1.5), assign the nodes around the edge to a starting set (effectively the ocean) and then randomly add nodes adjacent to the connected set in the Delaunay triangulation of the whole set to the connected set until you've connected them all, and then display the graph with edges weighted by the sum of upstream rainfall.

63501

Hai-Etlik

04-26-2014, 08:28 PM

Now with a weighted selection for flow direction that reduces the likelyhood of sharp bends and constrained hydrological divides.

63536

Here's the weighting function, where theta is the angle between the new segment and the downstream one. All the available downstream nodes are weighted and then one is selected randomly based on that weighting. This is designed to encourage some squiggle but avoid really sharp bends.

ToDoubleFunction<Optional<Double>> weight = theta->{

return Math.pow((Math.cos(theta.orElse(0.0))+1)/2, 100) - Math.pow((Math.cos(theta.orElse(0.0))+1)/2, 300)/4;

};

Hai-Etlik

04-26-2014, 08:45 PM

I think I may need to add a weighting to the selection of the next node to add, perhaps based on proximity to break lines. If nodes near the break line were selected later it would reduce the occurrence of rivers along the sides of break lines.

Hai-Etlik

04-26-2014, 09:06 PM

Weighting the selection with proximity to the break line helped immensely.

63538

ravells

04-26-2014, 09:07 PM

Holy moley! This looks fantastic!!!

Allow me to give you some reputation!

Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.