private void perturb(float f, float d) {
        int u, v;
        float[] tempMap = new float[width * depth];
        for (int x = 0; x < width; x++) {
            for (int z = 0; z < depth; z++) {
                u = x + (int) ((simplex.generate(f * x / (float) width, f * z / (float) depth) * 0.5 + 0.5) * d);
                v = z + (int) ((simplex.generate(f * x / (float) width, f * z / (float) depth) * 0.5 + 0.5) * d);
                if (u < 0) { u = 0; }
                if (u >= width) { u = width - 1; }
                if (v < 0) { v = 0; }
                if (v >= depth) { v = depth - 1; }
                tempMap[x + z * depth] = map[u + v * depth];
            }
        }
        map = tempMap;
    }