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 filas y
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.
preguntado el 01 de febrero de 12 a las 04:02
Si quieres una perfectamente documented implementation, check out este. You can download the código fuente y abierto
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 enlace directo to it. (If I'm mistaken about what LGLPL means and my ability to do this, please notify me.)
Check out the accepted answer. Ruido Perlin en Java . I am pretty sure this is exactly what you want to do. Just tweak the roughness variable and what is added whenever nextFloat() is called an you got yourself a filled 2d array of Perlin noise.