# Perlin Noise for 3d Voxel Terrain

Hi, I am trying to make a procedually generated 3d voxel terrain, i googled this alot an i still don´t understand Perlin Noise, the math behind it, how to appy it to the 3d Terrain and making it procedually, for example if i generate a Chunk, how to make the chunk next to it be a contination of the terrain.

Any libreries or explanaitions are really apreciated.

Should I use Mathf.PerlinNoise or external libraries?

Thank you

EDIT: ok so now i got this so far

``````		for (float px = 0; px < 16; px ++) {

//Our Y
for (float py = 0; py< 16; py ++) {
//1 valor juntez, 2
float Perlin1 = Mathf.PerlinNoise(px/80, RX);
float Perlin2 = Mathf.PerlinNoise(py/80, RY);
Color newColor = new Color( Random.value, Random.value, Random.value, 1.0f );
pos = new Vector3(py-PY, Perlin1*90*Perlin2, px-PX);
GameObject Block = (GameObject)Instantiate(terraincube, pos, Quaternion.identity);
Block.transform.parent = Container;
Block.name = "Block";
Block.renderer.material.color = newColor;

}
}
``````

I got this code from a forum post I edited it a bit to fit what i need, also it was in UnityScript.

It generates mountains or plains,t proe this is what i need but i dont know how to make
it procedually, like Chunk 1 continous CHUNK 2.

Also if anyone founds the exact link for download a librery with an easy way to implement perlin noise to the terrain i would really aprecciate it.

EDIT:

I found this library Which i thought i could be very useful until i did not found a way to implement this Noise to a Voxel Terrain, Anyone has any example script on how to apply it. Or the explanation.
This things would be really apprecciating. So Please if you have any infomation you would like to share with me Thank you.

CoherentNoise Gives you much more power than Mathf.PerlinNoise. It’s based on Simplex noise, which is a more efficient and superior method.

how to make the chunk next to it be a contination of the terrain

This is automatic if the inputs you give to the noise functions are continuous… like x, y world space positions are continuous through space.