MatrixTests RotateMatrix Method Delta Engine Documentation

Namespace: DeltaEngine.Tests.Datatypes
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void RotateMatrix()
Examples

[Test]
public void RotateMatrix()
{
    var matrix1 = new Matrix(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
    var matrix2 = new Matrix(0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1);
    var matrix3 = new Matrix(0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    var matrix4 = matrix1 * (matrix2 * matrix3);
    Assert.IsTrue(matrix1.IsNearlyEqual(Matrix.CreateRotationZYX(90, 0, 0)));
    Assert.IsTrue(matrix2.IsNearlyEqual(Matrix.CreateRotationZYX(0, 90, 0)));
    Assert.IsTrue(matrix3.IsNearlyEqual(Matrix.CreateRotationZYX(0, 0, 90)));
    Assert.IsTrue(matrix4.IsNearlyEqual(Matrix.CreateRotationZYX(90, 90, 90)));
}
See Also