Przeczytaj w języku angielskim Edytuj

Udostępnij za pośrednictwem


MatrixCamera.ViewMatrix Property

Definition

Gets or sets a Matrix3D as the view transformation matrix.

C#
public System.Windows.Media.Media3D.Matrix3D ViewMatrix { get; set; }

Property Value

A Matrix3D that represents the position, look direction and up vector for the camera.

Examples

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

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

Remarks

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.

Dependency Property Information

Item Value
Identifier field ViewMatrixProperty
Metadata properties set to true None

Applies to

Produkt Wersje
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10