Пример #1
0
        private void RecalculateMatrix(int type)
        {
            var moveventMatrix = new Matrix2D();
            var resizeMatrix = new Matrix2D();

            switch (type)
            {
                case 0:
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(0, 1.0 / 3.0 * 200),
                        resizeMatrix.ResizeMatrix(1.0, 1.0),
                        _matrices[0]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(0, 1.0 / 3.0 * 200),
                        resizeMatrix.ResizeMatrix(1.0, -1.0),
                        _matrices[1]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-200 / Math.Sqrt(3.0), -2.0 / 3.0 * 200),
                        resizeMatrix.ResizeMatrix(1.0, 1.0),
                        _matrices[2]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(200 / Math.Sqrt(3.0), -2.0 / 3.0 * 200),
                        resizeMatrix.ResizeMatrix(1.0, 1.0),
                        _matrices[3]);
                    break;
                case 1:
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(0, -1.0 / 3.0 * 100),
                        resizeMatrix.ResizeMatrix(2.0, 2.0),
                        _matrices[0]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[1]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[2]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[3]);
                    break;
                case 2:
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[0]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(0, -1.0 / 3.0 * 100),
                        resizeMatrix.ResizeMatrix(2.0, 2.0),
                        _matrices[1]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[2]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[3]);
                    break;
                case 3:
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[0]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[1]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(0, -1.0 / 3.0 * 100),
                        resizeMatrix.ResizeMatrix(2.0, 2.0),
                        _matrices[2]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[3]);
                    break;
                case 4:
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[0]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[1]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(-1000, -1000),
                        resizeMatrix.ResizeMatrix(1, 1),
                        _matrices[2]);
                    MatrixAbstract.Multiply(
                        moveventMatrix.MovementMatrix(0, -1.0 / 3.0 * 100),
                        resizeMatrix.ResizeMatrix(2.0, 2.0),
                        _matrices[3]);
                    break;
            }
        }