MatrixCamera.ProjectionMatrix 属性

定义

作为投影转换矩阵来获取或设置 Matrix3DGets or sets a Matrix3D as the projection transformation matrix.

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

指定投影转换的 Matrix3DMatrix3D that specifies the projection transformation.

示例

下面的代码将创建一个 MatrixCamera 并设置 ViewMatrixProjectionMatrix 属性。The following code creates a MatrixCamera and sets the ViewMatrix and ProjectionMatrix properties.

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

注解

对于实现其自己的投影矩阵计算的应用程序,此属性非常有用。This property is useful for applications that implement their own projection matrix calculation.

此属性将坐标系统从相机空间转换为规范化的多维数据集,其中 X 和 Y 坐标范围介于-1 到1之间,Z 坐标范围为0到1。This property transforms the coordinate system from camera space to a normalized cube where the X and Y coordinates range from -1 to 1 and the Z coordinate ranges from zero to 1. 相机空间中的最小和最大 Z 坐标由投影矩阵如何变换 Z 坐标定义。The minimum and maximum Z coordinates in camera space are defined by how the projection matrix transforms the Z coordinate.

依赖项属性信息Dependency Property Information

标识符字段Identifier field ProjectionMatrixProperty
元数据属性设置为trueMetadata properties set to true NoneNone

适用于