This documentation is archived and is not being maintained.

MatrixCamera.ViewMatrix Property

Gets or sets a Matrix3D as the view transformation matrix.

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

public Matrix3D ViewMatrix { get; set; }
    <Matrix3D .../>
<object ViewMatrix="Matrix3D" .../>

Property Value

Type: System.Windows.Media.Media3D.Matrix3D
A Matrix3Dthat represents the position, look direction and up vector for the camera.

Identifier field


Metadata properties set to true


This property is useful for applications that implement their own projection matrix calculation.

The camera properties specified by this matrix might differ from the top-level transform of the Model3D hierarchy.

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;

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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