示例#1
0
        public static MapHeights createSeabed(int w, int h)
        {
            MapHeights perlin = MapHeights.createPerlinNoise(w, h, (double)((int)(100000f / Form1.CELL_SIZE)) / 100000f, 20, 2);

            perlin.normalize(-1, -.6);
            perlin.Smooth(-1, -.6, 8);
            perlin.Smooth(-1, -.8, 5);
            return(perlin);
        }
示例#2
0
        public static MapHeights createHills(int w, int h)
        {
            MapHeights perlin = MapHeights.createPerlinNoise(w, h, (double)((int)(100000f / Form1.CELL_SIZE)) / 100000f, 5, 35);

            perlin.SimpleTransform(1);
            perlin.Smooth(0, .1, 8);
            perlin.Smooth(0, .2, 2);
            perlin.normalizeWithExtention(-.1, .38, .9);
            return(perlin);
        }
示例#3
0
        public static MapHeights createPlains(int w, int h)
        {
            MapHeights perlin = MapHeights.createPerlinNoise(w, h, (double)((int)(100000f / Form1.CELL_SIZE)) / 100000f, 10, 2);

            perlin.normalize(-.2, .3);
            perlin.Smooth(-.2, .3, 7);
            perlin.Smooth(.1, .3, 5);
            perlin.Smooth(-.2, .1, 3);
            perlin.Loosening(-.2, .3, 0.009, 1);
            return(perlin);
        }
示例#4
0
        public static MapHeights createMountains(int w, int h)
        {
            MapHeights perlin  = MapHeights.createPerlinNoise(w, h, (double)((int)(100000f / Form1.CELL_SIZE)) / 100000, 10, 25);
            MapHeights diamond = MapHeights.createDiamondSquare(w, h, .9);

            perlin.normalizeWithExtention(0, 1, .95);
            diamond.normalizeWithExtention(-.1, .4, .95);
            MapHeights union = createUnion(
                true,
                (int i, int j, MapHeights[] maps) =>
            {
                return(maps[0][i, j] + maps[1][i, j] * (maps[0][i, j] + 1.1) / 2.1f);
            },
                perlin,
                diamond);

            union.SimpleTransform(1);
            union.Loosening(0.4, 1, 0.03, 1);
            union.Loosening(0.7, 1, 0.08, 2);
            union.Smooth(0.4, 1, 1);
            union.normalizeWithExtention(-.5, 1, .97);
            return(union);
        }