Exemplo n.º 1
0
    private void AddPerlinNoise(Vector3[] vertices, PerlinNoiseLayer layer, float time)
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            var x = vertices[i].x * layer.Scale + time * layer.Speed;
            var z = vertices[i].z * layer.Scale + time * layer.Speed;

            vertices[i].y += (Mathf.PerlinNoise(x, z) - 0.5f) * layer.Height;
        }
    }
Exemplo n.º 2
0
    private static void AddPerlinNoise(Vector3[] vertices, PerlinNoiseLayer layer, float time)
    {
        for (int i = 0; i < vertices.Length; i++)
        {
            float x = vertices[i].x * layer.scale + time * layer.speed;
            float z = vertices[i].z * layer.scale + time * layer.speed;

            vertices[i].y = (Mathf.PerlinNoise(x, z) - 0.5f) * layer.height;
        }
    }