Export (0) Print
Expand All

MatrixCamera.ViewMatrix Property

Gets or sets a Matrix3D as the view transformation matrix. This is a dependency property.

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 Matrix3D ViewMatrix { get; set; }
<object>
  <object.ViewMatrix>
    <Matrix3D .../>
  </object.ViewMatrix>
</object>
<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

ViewMatrixProperty

Metadata properties set to true

None

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;
}

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

ADD
Show:
© 2014 Microsoft