Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

OrthographicCamera Class

Represents an orthographic projection camera.

Namespace: System.Windows.Media.Media3D
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public sealed class OrthographicCamera : ProjectionCamera
public final class OrthographicCamera extends ProjectionCamera
public final class OrthographicCamera extends ProjectionCamera
<OrthographicCamera .../>

This class specifies an orthogonal projection of a 3-D model to a 2-D visual surface. Like PerspectiveCamera, it specifies a position, viewing direction, and "upward" direction. Unlike PerspectiveCamera, however, OrthographicCamera describes a projection that does not include perspective foreshortening. In other words, OrthographicCamera describes a viewing box whose sides are parallel, instead of one whose sides meet in a point at the scene's horizon.

The following diagram shows the difference between orthographic and perspective-foreshortened camera projections.

Orthographic and perspective projection

The following example shows how to create an OrthographicCamera and toggle camera projections.

//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;

More Code

How to: Create a 3-D Scene

This example shows how to create a 3-D object that looks like a flat sheet of paper which has been rotated. A Viewport3D along with the following components are used to create this simple 3-D scene:

How to: Animate Camera Position and Direction in a 3D Scene

The following example shows how to animate the position of a camera and animate the direction it is pointing in a 3D scene. This is done by using Point3DAnimation and Vector3DAnimation to animate the Position and LookDirection properties respectively of the PerspectiveCamera. You might use an animation like this to change the onlooker's view of a scene in response to an event.

How to: Animate Camera Position and Direction Using Key Frames

In the following example, Point3DAnimationUsingKeyFrames is used to animate the position of a PerspectiveCamera in a 3D scene. In addition, Vector3DAnimationUsingKeyFrames is used to animate the direction the camera is pointing in the 3D scene. Both of these animations use several key frames which create a series of animation effects:


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

© 2015 Microsoft