Marcus13345
Marcus13345

Reputation: 63

Generating a heightMap without an Image

I want to make a world generator so that every time I load it, it generates a new heightmap. To do this I'm using a 2D integer array. The dimensions are the x, z, and the height (y).

Is there some simple generation algorithm that will randomize the terrain?

Upvotes: 1

Views: 4214

Answers (1)

Matěj Zábský
Matěj Zábský

Reputation: 17272

This is probably the most well-known page describing implementation of Perlin noise - it has all you need, you just need to put a bit of effort into understanding it.

If you are in Java and want ready-to-use solution, you could also use the noise generator implemented in Java3D. There are also many more Perlin noise implementations floating around the web.

I personally prefer the diamond-square algorithm to the Perlin noise. It tends to generate less axially biased noise (that terrain features are suspiciously parallel to either of the main axes, creating visually distracting elements).

Upvotes: 4

Related Questions