共用方式為


MatrixCamera.ViewMatrix 屬性

定義

取得或設定 Matrix3D 做為檢視轉換矩陣。

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

屬性值

Matrix3D 表示相機的位置、外觀方向和向上向量。

範例

下列程式碼會 MatrixCamera 建立 並設定 ViewMatrixProjectionMatrix 屬性。

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

備註

此屬性適用于實作自己的投影矩陣計算的應用程式。

此矩陣所指定的相機屬性可能與階層的最上層轉換 Model3D 不同。

相依性屬性資訊

識別碼欄位 ViewMatrixProperty
中繼資料屬性設定為 true

適用於