Beispiel #1
0
        private static void GeneratePrecipitation(PolygonMapGenerator PMG)
        {
            int polePrecipitation    = 0;
            int equatorPrecipitation = 5000;
            PrecipitationNoise noise = new PrecipitationNoise(polePrecipitation, equatorPrecipitation);

            foreach (GraphPolygon polygon in PMG.Polygons)
            {
                float noiseValue = noise.GetValue(polygon.CenterPoi.x, polygon.CenterPoi.y, PMG.GenerationSettings);
                polygon.Precipitation = (int)noiseValue;
            }

            //if (Visualize) NoiseTester.DisplayNoise(noise, NoiseTester.PrecipitationPlane, MapData, polePrecipitation, equatorPrecipitation);
        }
Beispiel #2
0
    private static void GeneratePrecipitation()
    {
        int polePrecipitation    = 0;
        int equatorPrecipitation = 5000;
        PrecipitationNoise noise = new PrecipitationNoise(polePrecipitation, equatorPrecipitation);

        foreach (TileData td in MapData.Tiles)
        {
            float noiseValue = noise.GetValue(td.Position.x, td.Position.z, MapData);
            td.Precipitation = (int)noiseValue;
        }

        if (Visualize)
        {
            NoiseTester.DisplayNoise(noise, NoiseTester.PrecipitationPlane, MapData, polePrecipitation, equatorPrecipitation);
        }
    }