Viewport3D.Camera Vlastnost
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Získá nebo nastaví objekt kamery, který projektuje prostorový obsah Viewport3D 2D povrchu 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
Hodnota vlastnosti
Fotoaparát, který projekcí prostorový obsah na prostorový povrch.
Příklady
Následující příklad ukazuje nastavení Camera vlastnosti Viewport3D using kódu. Pokud chcete zobrazit celý kód, ze kterého byl tento výňatek pořízen, podívejte se na postupy: Vytvoření prostorové scény.
// 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
Následující příklad ukazuje nastavení Camera vlastnosti Viewport3D using Extensible Application Markup Language (XAML). Pokud chcete zobrazit celý kód, ze kterého byl tento výňatek pořízen, podívejte se na postupy: Vytvoření prostorové scény.
<!-- 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>
Poznámky
Tato vlastnost představuje zobrazení zobrazení prostorové scény.
Informace o vlastnosti závislosti
| Položka | Hodnota |
|---|---|
| Pole Identifikátor | CameraProperty |
Vlastnosti metadat nastavené na true |
None |
Poznámka:
Typ metadat pro tuto vlastnost závislosti je PropertyMetadata, nikoli FrameworkPropertyMetadata.