Perlin Noise.

I downloaded The ported librery LibNoise, to use Perlin Noise, I am quite new to this, so I started learning my self and i got stuck here. To generate using perlin Noise I need a method called GetNoiseValue(x, z) Which i saw in a C++ tutorial using this library.

Well, I couldnt find it in unity the closest I found was GetValue(x, y ,z) but as you can see i have to give a height value also.

Any ideas, suggestions? Thanks

This function should generate ‘flat’ (not spherical) procedural terrain. Also make sure you have ‘amplitude’ and ‘seed’ public variables (integers for seed and float or int for amplitude) somewhere in your code.

	public void ApplyNoise () {
			
			Perlin noise;
			noise = new Perlin();
			noise.Seed = seed;
				
			MeshFilter meshFilter = GetComponent<MeshFilter>();
			Mesh mesh = meshFilter.mesh;
			Vector3[] verts = mesh.vertices;
				
			for(int i = 0; i < verts.Length; i++){
					
				Vector3 pos = verts*.normalized;*
  •  		float noiseValue = (float)noise.GetValue(pos.x, pos.y, pos.z);*
    

verts_.y = (noiseValue * amplitude);_

* }*

* mesh.vertices = verts;*
* mesh.RecalculateNormals();*
mesh.RecalculateBounds();
//the mesh collider can also be updated here if you’re using one

* }*