Viewport3D::Camera Property

 

Gets or sets a camera object that projects the 3-D contents of the Viewport3D to the 2-D surface of the Viewport3D.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public:
property Camera^ Camera {
	Camera^ get();
	void set(Camera^ value);
}

Property Value

Type: System.Windows.Media.Media3D::Camera^

The camera that projects the 3-D contents to the 2-D surface.

This property represents the viewing projection of the 3-D scene.

Identifier field

CameraProperty

Metadata properties set to true

None

System_CAPS_noteNote

The metadata type on this dependency property is PropertyMetadata, not FrameworkPropertyMetadata.

The following example shows setting the Camera property of a Viewport3D using code. To see the entirety of the code from which this excerpt was taken, see How to: Create a 3-D Scene.

No code example is currently available or this language may not be supported.

The following example shows setting the Camera property of a Viewport3D using Extensible Application Markup Language (XAML). To see the entirety of the code from which this excerpt was taken, see How to: Create a 3-D Scene.

<!-- Add a camera. -->
<Viewport3D.Camera>
	<PerspectiveCamera FarPlaneDistance="20" LookDirection="5,-2,-3" UpDirection="0,1,0" NearPlaneDistance="1" Position="-5,2,3" FieldOfView="45" />
</Viewport3D.Camera>

.NET Framework
Available since 3.0
Return to top
Show: