예제 #1
0
    public void fillWithNoise(int offsetX, int offsetY, int offsetZ, Noise2D heightNoise)
    {
        for (int x = 0; x < width; ++x)
        {
            for (int z = 0; z < depth; ++z)
            {
                int noiseHeight = heightNoise.generate(offsetX + x, offsetZ + z);

                for (int y = 0; y < height; ++y)
                {
                    if (offsetY + y < noiseHeight)
                    {
                        SetValue(x, y, z, 1);
                    }
                    else
                    {
                        SetValue(x, y, z, 0);
                    }
                }
            }
        }
    }