TerrainGeneration

From OpenCity

State of Art

Implementation

An abstract base class for TerrainGenerator, and at lest inherited by

  • a generator
  • an heightmap file loader

Plus tools like

minL, maxL = getMinMax(map);
a = (max-min) / (maxL-minL);
b = -minL*a+min;
place = a*(place-minL)+min
min, max = getMinMax(map);
coef = max-min;
place = (((place-min)/coef)^power)*coef+min
  • gaussian blur: smoth and lowlevel filter
  • flooding
  • rivers/lakes calculator
  • and maybe some singularity generators (crater, caldera, ...).
Personal tools