I am having issues with my perlin noise terrain generation in javascript. All the hills are pointing one way.
Another issue I have is that diagonally through the middle of my map my terrain gets screwed up.
https://i.stack.imgur.com/YPLSz.png
Here's my code:
//Generate terrain
var xoff = 0;
var zoff = 0;
var inc = 0.005;
var amplitude = 100;
for (var x = 0; x <= worldDiameter+1; x++) {
xoff = 0;
for (var z = 0; z <= worldDiameter+1; z++) {
var heightValue = (noise.perlin2(xoff, zoff) * amplitude);
mapGeometry.attributes.position.setZ(z*worldDiameter+x, heightValue);
xoff = xoff + inc;
}
zoff = zoff + inc;
}```