Esporta (0) Stampa
Espandi tutto

Classe OrthographicCamera

Represents an orthographic projection camera.

Spazio dei nomi: System.Windows.Media.Media3D
Assembly: PresentationCore (in presentationcore.dll)
Spazio dei nomi XML:  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

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.

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

Altro codice

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:

System.Object
   System.Windows.Threading.DispatcherObject
     System.Windows.DependencyObject
       System.Windows.Freezable
         System.Windows.Media.Animation.Animatable
           System.Windows.Media.Media3D.Camera
             System.Windows.Media.Media3D.ProjectionCamera
              System.Windows.Media.Media3D.OrthographicCamera

I membri statici pubblici (Shared in Visual Basic) di questo tipo sono validi per le operazioni multithreading. I membri di istanza non sono garantiti come thread safe.

Microsoft .NET Framework 3.0 è supportato in Windows Vista, Microsoft Windows XP SP2 e Windows Server 2003 SP1.

.NET Framework

Supportato in:

Aggiunte alla community

AGGIUNGI
Microsoft sta conducendo un sondaggio in linea per comprendere l'opinione degli utenti in merito al sito Web di MSDN. Se si sceglie di partecipare, quando si lascia il sito Web di MSDN verrà visualizzato il sondaggio in linea.

Si desidera partecipare?
Mostra:
© 2014 Microsoft