Hello, after 2 days of researching i am still struggling with 1D perlin noise. Tried to search over the network for some source code, so i understand how it works, but still no understanding from me.
The best i did with 1D perlin :
And it doesn’t look like terrain to be honest, haha…
2D perlin does not do my job, because i am doing sidescroller and it does top-down style terrain…
PerlinNoiseGenerator noise = new PerlinNoiseGenerator(111);
float freq = 0.9f;
for(int i = 1; i <= planetSize; i++) {
Chunk chunky = new Chunk(Constants.CHUNK_SIZE);
c[i - 1] = chunky;
for(int x = 0; x < Constants.CHUNK_SIZE; x++) {
float height = noise.noise1((float)((x * i) * freq));
for(float y = 0 + height; y < Constants.CHUNK_SIZE; y++) {
if(y >= -0.0f) {
c[i - 1].getTilesInChunk()[x][(int) y] = new Tile(x * i,(int) y, TileType.DIRT);
} else {
c[i - 1].getTilesInChunk()[x][(int) y] = new Tile(x * i, (int)y, TileType.NONE);
}
}
}