OrthographicCamera Constructor (Point3D, Vector3D, Vector3D, Double)

 

Initializes a new instance of the OrthographicCamera class with the specified position, projection direction, upward direction, and width.

Namespace:   System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public OrthographicCamera(
	Point3D position,
	Vector3D lookDirection,
	Vector3D upDirection,
	double width
)

Parameters

position
Type: System.Windows.Media.Media3D.Point3D

A Point3D that specifies the camera position.

lookDirection
Type: System.Windows.Media.Media3D.Vector3D

A Vector3D that specifies the direction of the camera's projection.

upDirection
Type: System.Windows.Media.Media3D.Vector3D

A Vector3D that specifies the upward direction according to the perspective of the onlooker.

width
Type: System.Double

The width of the camera's viewing box, in world units.

The following code instantiates an 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;
    }
}

.NET Framework
Available since 3.0
Return to top
Show: