共用方式為


MatrixCamera 建構函式

定義

建立新的 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

適用於