OrthographicCamera 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 OrthographicCamera 類別的新執行個體。
多載
OrthographicCamera() |
初始化 OrthographicCamera 類別的新執行個體。 |
OrthographicCamera(Point3D, Vector3D, Vector3D, Double) |
初始化 OrthographicCamera 類別的新執行個體,這個執行個體具有指定的位置、投影方向、向上方向和寬度。 |
OrthographicCamera()
初始化 OrthographicCamera 類別的新執行個體。
public:
OrthographicCamera();
public OrthographicCamera ();
Public Sub New ()
範例
下列範例會具現化 OrthographicCamera 。
//Toggle between camera projections.
public void ToggleCamera(object sender, EventArgs e)
{
if ((bool)CameraCheck.IsChecked == true)
{
OrthographicCamera myOCamera = new OrthographicCamera(new Point3D(0, 0, -3), new Vector3D(0, 0, 1), new Vector3D(0, 1, 0), 3);
myViewport.Camera = myOCamera;
}
if ((bool)CameraCheck.IsChecked != true)
{
PerspectiveCamera myPCamera = new PerspectiveCamera(new Point3D(0, 0, -3), new Vector3D(0, 0, 1), new Vector3D(0, 1, 0), 50);
myViewport.Camera = myPCamera;
}
}
'Toggle between camera projections.
Public Sub ToggleCamera(ByVal sender As Object, ByVal e As EventArgs)
If CBool(CameraCheck.IsChecked) = True Then
Dim myOCamera As New OrthographicCamera(New Point3D(0, 0, -3), New Vector3D(0, 0, 1), New Vector3D(0, 1, 0), 3)
myViewport.Camera = myOCamera
End If
If CBool(CameraCheck.IsChecked) <> True Then
Dim myPCamera As New PerspectiveCamera(New Point3D(0, 0, -3), New Vector3D(0, 0, 1), New Vector3D(0, 1, 0), 50)
myViewport.Camera = myPCamera
End If
End Sub
適用於
OrthographicCamera(Point3D, Vector3D, Vector3D, Double)
初始化 OrthographicCamera 類別的新執行個體,這個執行個體具有指定的位置、投影方向、向上方向和寬度。
public:
OrthographicCamera(System::Windows::Media::Media3D::Point3D position, System::Windows::Media::Media3D::Vector3D lookDirection, System::Windows::Media::Media3D::Vector3D upDirection, double width);
public OrthographicCamera (System.Windows.Media.Media3D.Point3D position, System.Windows.Media.Media3D.Vector3D lookDirection, System.Windows.Media.Media3D.Vector3D upDirection, double width);
new System.Windows.Media.Media3D.OrthographicCamera : System.Windows.Media.Media3D.Point3D * System.Windows.Media.Media3D.Vector3D * System.Windows.Media.Media3D.Vector3D * double -> System.Windows.Media.Media3D.OrthographicCamera
Public Sub New (position As Point3D, lookDirection As Vector3D, upDirection As Vector3D, width As Double)
參數
- width
- Double
相機檢視方塊的寬度,以全局單位表示。
範例
下列程式碼會具現化 OrthographicCamera 。
//Toggle between camera projections.
public void ToggleCamera(object sender, EventArgs e)
{
if ((bool)CameraCheck.IsChecked == true)
{
OrthographicCamera myOCamera = new OrthographicCamera(new Point3D(0, 0, -3), new Vector3D(0, 0, 1), new Vector3D(0, 1, 0), 3);
myViewport.Camera = myOCamera;
}
if ((bool)CameraCheck.IsChecked != true)
{
PerspectiveCamera myPCamera = new PerspectiveCamera(new Point3D(0, 0, -3), new Vector3D(0, 0, 1), new Vector3D(0, 1, 0), 50);
myViewport.Camera = myPCamera;
}
}
'Toggle between camera projections.
Public Sub ToggleCamera(ByVal sender As Object, ByVal e As EventArgs)
If CBool(CameraCheck.IsChecked) = True Then
Dim myOCamera As New OrthographicCamera(New Point3D(0, 0, -3), New Vector3D(0, 0, 1), New Vector3D(0, 1, 0), 3)
myViewport.Camera = myOCamera
End If
If CBool(CameraCheck.IsChecked) <> True Then
Dim myPCamera As New PerspectiveCamera(New Point3D(0, 0, -3), New Vector3D(0, 0, 1), New Vector3D(0, 1, 0), 50)
myViewport.Camera = myPCamera
End If
End Sub