MatrixCamera.ViewMatrix 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 為 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
屬性值
A Matrix3D 代表相機的位置、視角方向和向上向量。
範例
以下程式碼會建立 , MatrixCamera 並設定 ViewMatrix 和 ProjectionMatrix 屬性。
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 不同。
相依財產資訊
| Item | 價值觀 |
|---|---|
| 識別碼欄位 | ViewMatrixProperty |
元資料屬性設為 true |
None |