public void RandomMatrixMultiplication()
        {
            // http://i.stack.imgur.com/ehGJn.gif
            var expected = new Matrix44(
                -1, +0, +0, +0,
                +0, +1, +0, +0,
                +0, +0, -1, +0,
                +0, -1, -1, +1
            );

            var matrixA = new Matrix44(
                -1, +0, +0, +0,
                +0, +1, +0, +0,
                +0, +0, -1, +0,
                +0, +0, +0, +1
            );

            var matrixB = new Matrix44(
                +1, +0, +0, +0,
                +0, +1, +0, +0,
                +0, +0, +1, +0,
                +0, -1, -1, +1
            );

            var actual = matrixA * matrixB;
            Assert.AreEqual(expected, actual);
        }
예제 #2
0
 public Transform3D RotateY(double angle)
 {
     this.matrix *= Matrix44.GetRotationY(angle);
     return this;
 }
예제 #3
0
 public Transform3D Translate(Vector3 offset)
 {
     this.matrix *= Matrix44.GetTranslation(offset.X, offset.Y, offset.Z);
     return this;
 }
예제 #4
0
 public Transform3D Reset()
 {
     this.matrix = Matrix44.Identity;
     return this;
 }
예제 #5
0
 public Transform3D(Matrix44 matrix)
 {
     this.matrix = matrix;
 }