Viewport3D.Camera Właściwość
Definicja
Pobiera lub ustawia obiekt aparatu fotograficznego, który projektuje 3-W3-D zawartość na Viewport3D 2-W2-D powierzchni Viewport3D .Gets or sets a camera object that projects the 3-W3-D contents of the Viewport3D to the 2-W2-D surface of the Viewport3D.
public:
property System::Windows::Media::Media3D::Camera ^ Camera { System::Windows::Media::Media3D::Camera ^ get(); void set(System::Windows::Media::Media3D::Camera ^ value); };
public System.Windows.Media.Media3D.Camera Camera { get; set; }
member this.Camera : System.Windows.Media.Media3D.Camera with get, set
Public Property Camera As Camera
Wartość właściwości
Aparat, który projektuje 3-W3-D zawartość na 2-W2-D powierzchnię.The camera that projects the 3-W3-D contents to the 2-W2-D surface.
Przykłady
Poniższy przykład pokazuje Ustawianie Camera właściwości Viewport3D kodu przy użyciu.The following example shows setting the Camera property of a Viewport3D using code. Aby zobaczyć całości kodu, z którego zrobiono ten fragment, zobacz How to : Create a 3D scena.To see the entirety of the code from which this excerpt was taken, see How to: Create a 3-D Scene.
// Defines the camera used to view the 3D object. In order to view the 3D object,
// the camera must be positioned and pointed such that the object is within view
// of the camera.
PerspectiveCamera myPCamera = new PerspectiveCamera();
// Specify where in the 3D scene the camera is.
myPCamera.Position = new Point3D(0, 0, 2);
// Specify the direction that the camera is pointing.
myPCamera.LookDirection = new Vector3D(0, 0, -1);
// Define camera's horizontal field of view in degrees.
myPCamera.FieldOfView = 60;
// Asign the camera to the viewport
myViewport3D.Camera = myPCamera;
' Defines the camera used to view the 3D object. In order to view the 3D object,
' the camera must be positioned and pointed such that the object is within view
' of the camera.
Dim myPCamera As New PerspectiveCamera()
' Specify where in the 3D scene the camera is.
myPCamera.Position = New Point3D(0, 0, 2)
' Specify the direction that the camera is pointing.
myPCamera.LookDirection = New Vector3D(0, 0, -1)
' Define camera's horizontal field of view in degrees.
myPCamera.FieldOfView = 60
' Asign the camera to the viewport
myViewport3D.Camera = myPCamera
Poniższy przykład pokazuje Ustawianie Camera właściwości Viewport3D przy użyciu Extensible Application Markup Language (XAML)Extensible Application Markup Language (XAML) .The following example shows setting the Camera property of a Viewport3D using Extensible Application Markup Language (XAML)Extensible Application Markup Language (XAML). Aby zobaczyć całości kodu, z którego zrobiono ten fragment, zobacz How to : Create a 3D scena.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>
Uwagi
Ta właściwość reprezentuje projekcję 3-W3-D sceny.This property represents the viewing projection of the 3-W3-D scene.
Informacje dotyczące właściwości zależnościDependency Property Information
Pole identyfikatoraIdentifier field | CameraProperty |
Właściwości metadanych ustawione na true Metadata properties set to true |
BrakNone |
Uwaga
Typ metadanych dla tej właściwości zależności to PropertyMetadata , nie FrameworkPropertyMetadata .The metadata type on this dependency property is PropertyMetadata, not FrameworkPropertyMetadata.