MatrixTests CreateOrtographicProjectionMatrix 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 CreateOrtographicProjectionMatrix()
Examples

[Test]
public void CreateOrtographicProjectionMatrix()
{
    var size = new Size(10, 5);
    matrix = Matrix.CreateOrthoProjection(size);
    var expected = new Matrix(0.2f, 0.0f, 0.0f, 0.0f, 0.0f, -0.4f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f,
        0.0f, -1.0f, 1.0f, 0.0f, 1.0f);
    Assert.AreEqual(expected, matrix);
}
[Test]
public void CreateOrtographicProjectionMatrixwithNearAndFarPlanes()
{
    var size = new Size(10, 5);
    matrix = Matrix.CreateOrthoProjection(size, 0.1f, 10.0f);
    var expected = new Matrix(0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 0.4f, 0.0f, 0.0f, 0.0f, 0.0f, -0.202f,
        0.0f, 0.0f, 0.0f, -1.0202f, 1.0f);
    Assert.IsTrue(expected.IsNearlyEqual(matrix));
}
See Also