This is my current code:
private double dampen(double value) {
return value * DAMPENING + OFFSET;
}
private double normalize(double value, int x, int y) {
double leftRightAvg = (heightMap[x - 1][y] + heightMap[x + 1][y]) / 2;
double bottomTopAvg = (heightMap[x][y - 1] + heightMap[x][y - 1]) / 2;
double avg = (leftRightAvg + bottomTopAvg) / 2;
double delta = value - avg;
delta *= NORMALIZER;
return avg + delta;
}
private double NORMALIZER = 0.75, DAMPENING = 0.55, OFFSET = 0.15;
public void generate() {
SimplexNoiseGenerator.genGrad(new FastRand(seed));
for (int pointer1 = 0; pointer1 < heightMap.length; pointer1++) {
for (int pointer2 = 0; pointer2 < heightMap[0].length; pointer2++) {
heightMap[pointer1][pointer2] = dampen(SimplexNoiseGenerator.noise(pointer1, pointer2));
}
}
for (int pointer1 = 1; pointer1 < heightMap.length - 1; pointer1++) {
for (int pointer2 = 1; pointer2 < heightMap[0].length - 1; pointer2++) {
heightMap[pointer1][pointer2] = normalize(heightMap[pointer1][pointer2], pointer1, pointer2);
}
}
}
I guess I invisioned (because this is my first dive into simplex noise) that there would be smooth drops around a few peaks. Where should I search for achieving something like this?
CopyableCougar4