Пример #1
0
        private Image getPlanetSurface()
        {
            int startx = rand.Next(0, 94544);
            int starty = rand.Next(0, 94544);

            Color[,] colors = new Color[800, 600];
            NoiseMap mapr = Utils.getNoiseMap(startx, starty, 6, 6, 2.7, 0.8);

            for (int i = 0; i < 800; i++)
            {
                for (int j = 0; j < 600; j++)
                {
                    byte r = Utils.NormNoise(mapr.GetValue(i, j));
                    colors[i, j] = new Color(r, r, r);
                }
            }
            GradientBuilder grad = new GradientBuilder();

            grad.AddGradient(new Gradient(0, Color.Gray));
            grad.AddGradient(new Gradient(20, Color.OrangeRed));
            grad.AddGradient(new Gradient(225, Color.Orange));
            grad.AddGradient(new Gradient(255, Color.LightGray));
            grad.PrepareGradients();
            grad.SourceImage = new Image(colors);
            return(grad.Render());
        }
        private Image getPlanetSurface()
        {
            int startx = rand.Next(0, 94544);
            int starty = rand.Next(0, 94544);

            Color[,] colors = new Color[800, 600];
            NoiseMap mapr = Utils.getNoiseMap(startx, starty, 12, 12, 3.1, 0.9);

            for (int i = 0; i < 800; i++)
            {
                for (int j = 0; j < 600; j++)
                {
                    byte r = Utils.NormNoise(mapr.GetValue(i, j));
                    colors[i, j] = new Color(r, r, r);
                }
            }
            GradientBuilder grad = new GradientBuilder();
            Color           grey = new Color(150, 150, 150);

            grad.AddGradient(new Gradient(0, grey));
            grad.AddGradient(new Gradient(255, Color.White));
            grad.PrepareGradients();
            grad.SourceImage = new Image(colors);
            return(grad.Render());
        }
        private Image getPlanetSurface(int startx, int starty)
        {
            Color[,] colors = new Color[800, 600];
            NoiseMap mapr = Utils.getNoiseMap(startx, starty, 12, 12, 2.7, 0.8);

            for (int i = 0; i < 800; i++)
            {
                for (int j = 0; j < 600; j++)
                {
                    byte r = Utils.NormNoise(mapr.GetValue(i, j));
                    colors[i, j] = new Color(r, r, r);
                }
            }
            GradientBuilder grad = new GradientBuilder();

            grad.AddGradient(new Gradient(0, Color.Blue));
            grad.AddGradient(new Gradient(50, Color.Yellow));
            grad.AddGradient(new Gradient(140, Color.Green));
            grad.AddGradient(new Gradient(255, Color.White));
            grad.PrepareGradients();
            grad.SourceImage = new Image(colors);
            return(grad.Render());
        }