MatrixCamera 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建一个新的 MatrixCamera。
重载
MatrixCamera() |
创建 MatrixCamera 的新实例。 |
MatrixCamera(Matrix3D, Matrix3D) |
通过视图和投影矩阵创建一个新的 MatrixCamera。 |
MatrixCamera()
创建 MatrixCamera 的新实例。
public:
MatrixCamera();
public MatrixCamera ();
Public Sub New ()
示例
以下代码创建 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
适用于
MatrixCamera(Matrix3D, Matrix3D)
通过视图和投影矩阵创建一个新的 MatrixCamera。
public:
MatrixCamera(System::Windows::Media::Media3D::Matrix3D viewMatrix, System::Windows::Media::Media3D::Matrix3D projectionMatrix);
public MatrixCamera (System.Windows.Media.Media3D.Matrix3D viewMatrix, System.Windows.Media.Media3D.Matrix3D projectionMatrix);
new System.Windows.Media.Media3D.MatrixCamera : System.Windows.Media.Media3D.Matrix3D * System.Windows.Media.Media3D.Matrix3D -> System.Windows.Media.Media3D.MatrixCamera
Public Sub New (viewMatrix As Matrix3D, projectionMatrix As Matrix3D)
参数
- viewMatrix
- Matrix3D
指定照相机的视图矩阵。
- projectionMatrix
- 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