Sdílet prostřednictvím


MatrixCamera.ViewMatrix Vlastnost

Definice

Získá nebo nastaví Matrix3D jako transformační matici zobrazení.

public:
 property System::Windows::Media::Media3D::Matrix3D ViewMatrix { System::Windows::Media::Media3D::Matrix3D get(); void set(System::Windows::Media::Media3D::Matrix3D value); };
public System.Windows.Media.Media3D.Matrix3D ViewMatrix { get; set; }
member this.ViewMatrix : System.Windows.Media.Media3D.Matrix3D with get, set
Public Property ViewMatrix As Matrix3D

Hodnota vlastnosti

Matrix3D

A Matrix3D , který představuje pozici, směr a směr a nahoru pro kameru.

Příklady

Následující kód vytvoří MatrixCamera a nastaví ViewMatrix vlastnosti a ProjectionMatrix vlastnosti.

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;
}
Private Sub SetMatrixCamera(ByVal sender As Object, ByVal e As EventArgs)
    'Define matrices for ViewMatrix and ProjectionMatrix properties.
    Dim vmatrix As New Matrix3D(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
    Dim pmatrix As New Matrix3D(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)

    Dim mCamera As New MatrixCamera(vmatrix, pmatrix)
    myViewport.Camera = mCamera
End Sub

Poznámky

Tato vlastnost je užitečná pro aplikace, které implementují vlastní výpočet matice projekce.

Vlastnosti kamery určené touto maticí se můžou lišit od transformace Model3D hierarchie nejvyšší úrovně.

Informace o vlastnosti závislosti

Pole identifikátoru ViewMatrixProperty
Vlastnosti metadat nastavené na true Žádné

Platí pro