Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

MatrixCamera Class

Camera which specifies the view and projection transforms as Matrix3D objects

Namespace:  System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public ref class MatrixCamera sealed : public 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

Community Additions

© 2015 Microsoft