Пример #1
0
        public Blend()
        {
            InitializeComponent();

            List <PlotInfo3D> data = new List <PlotInfo3D>();

            for (int x = 0; x < this.maxX; x++)
            {
                for (int y = 0; y < this.maxY; y++)
                {
                    double     z         = GetZ(x, y);
                    Color      itemColor = GetItemColor(x, y);
                    PlotInfo3D pi        = new PlotInfo3D {
                        X = x, Y = y, Z = z, ItemColor = itemColor,
                    };
                    data.Add(pi);
                }
            }

            this.DataContext = data;
        }
Пример #2
0
        public Tiles()
        {
            InitializeComponent();

            List <PlotInfo3D> data = new List <PlotInfo3D>();
            double            maxX = 10;
            double            maxY = 10;

            for (int x = 0; x < maxX; x++)
            {
                for (int y = 0; y < maxY; y++)
                {
                    double     xValue = Math.Sin(x * Math.PI / maxX);
                    double     yValue = Math.Cos(y * Math.PI / maxY);
                    double     z      = 200 * xValue * yValue;
                    PlotInfo3D pi     = new PlotInfo3D {
                        X = x, Y = y, Z = z, ItemColor = GetItemColor(z)
                    };
                    data.Add(pi);
                }
            }

            this.DataContext = data;
        }