コード例 #1
0
        /// <summary>
        /// Build a heightmap based on perlin noise.
        /// </summary>
        public static IHeightMap Build(float minHeight, float maxHeight, float scale, int seed)
        {
            if (minHeight == maxHeight)
            {
                return(new ConstantHeightMap(minHeight));
            }

            var noise = new LayeredNoise(scale, seed);

            return(new PerlinHeightMap(noise, minHeight, maxHeight));
        }
コード例 #2
0
        /// <summary>
        /// Build a heightmap out of multiple layers of perlin noise.
        /// </summary>
        public static IHeightMap Build(float minHeight, float maxHeight, float scale, int seed,
                                       int numLayers, float amplitudeFactor, float frequencyGrowth)
        {
            if (minHeight == maxHeight || numLayers == 0)
            {
                return(new ConstantHeightMap(minHeight));
            }

            var noise = new LayeredNoise(numLayers, amplitudeFactor, frequencyGrowth, scale, seed);

            return(new PerlinHeightMap(noise, minHeight, maxHeight));
        }