MatrixCamera.ProjectionMatrix 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 a Matrix3D 作為投影轉換矩陣。
public:
property System::Windows::Media::Media3D::Matrix3D ProjectionMatrix { System::Windows::Media::Media3D::Matrix3D get(); void set(System::Windows::Media::Media3D::Matrix3D value); };
public System.Windows.Media.Media3D.Matrix3D ProjectionMatrix { get; set; }
member this.ProjectionMatrix : System.Windows.Media.Media3D.Matrix3D with get, set
Public Property ProjectionMatrix As Matrix3D
屬性值
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
備註
此特性對於實作自身投影矩陣計算的應用非常有用。
此特性將座標系統從相機空間轉換為正規化立方體,其中 X 與 Y 座標範圍為 -1 至 1,Z 座標範圍為 0 至 1。 相機空間中的最小與最大 Z 座標由投影矩陣如何轉換 Z 座標來定義。
相依財產資訊
| Item | 價值觀 |
|---|---|
| 識別碼欄位 | ProjectionMatrixProperty |
元資料屬性設為 true |
None |