How Do I Fill a 2D Array With Perlin Noise?

Sonic42 picture Sonic42 · Feb 1, 2012 · Viewed 10.4k times · Source

I've devised a small personal project to help me learn how to use Perlin Noise. This project involves filling a 2D array of r rows and c columns with random, coherent data generated with a Perlin Noise algorithm.

Now, I've just spent hours reading a wide variety of resources about generating Perlin Noise. However, it's all over my head and I'm totally lost. I understand the basic concept, but I don't have a clue how to begin implementing this in Java. I think it would be most helpful if someone could show me some well-commented code that accomplishes my goal so I can work backwards and apply it myself.

Answer

Zenexer picture Zenexer · Feb 9, 2012

If you want a perfectly documented implementation, check out this. You can download the source code and open src\java\org\j3d\texture\procedural\PerlinNoiseGenerator.java to get your commented code. I take no credit for any of this. All I did was hunt around on Google a bit.

Since it's licensed under LGLPL, I'll also provide a direct link to it. (If I'm mistaken about what LGLPL means and my ability to do this, please notify me.)