This documentation is archived and is not being maintained.

MatrixCamera Class

Camera which specifies the view and projection transforms as Matrix3D objects

Namespace:  System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public final class MatrixCamera extends Camera
<MatrixCamera .../>

This camera enables applications to calculate their own view and projection matrices. This allows applications to define cameras not directly supported by the ProjectionCamera subclasses.

Using a MatrixCamera is the only way an application can know what the View/Projection matrices are.

A MatrixCamera can be animated using the Transform property.

The following code creates a MatrixCamera and sets the ViewMatrix and ProjectionMatrix properties.

private void SetMatrixCamera(object sender, EventArgs e)
    //Define matrices for ViewMatrix and ProjectionMatrix properties.
    Matrix3D vmatrix = new Matrix3D(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    Matrix3D pmatrix = new Matrix3D(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);

    MatrixCamera mCamera = new MatrixCamera(vmatrix, pmatrix);
    myViewport.Camera = mCamera;

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0