Viewport3D.Camera 속성

정의

3차원 콘텐츠를 Viewport3D 2차원 표면 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

속성 값

Camera

3차원 콘텐츠를 2차원 표면에 투영하는 카메라입니다.

예제

다음 예제에서는 설정 합니다 Camera 의 속성을 Viewport3D 코드를 사용 하 여. 이 발췌 수행한 코드 전체를 보려면 방법: 3 차원 장면 만들기합니다.

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

다음 예제에서는 XAML(Extensible Application Markup Language) 사용 속성을 Viewport3D 설정하는 Camera 방법을 보여 줍니다. 이 발췌 수행한 코드 전체를 보려면 방법: 3 차원 장면 만들기합니다.

<!-- 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>

설명

이 속성은 3차원 장면의 보기 프로젝션을 나타냅니다.

종속성 속성 정보

식별자 필드 CameraProperty
메타 데이터 속성 설정 true 없음

참고

이 종속성 속성의 메타 데이터 유형이 PropertyMetadata이 아니라 FrameworkPropertyMetadata합니다.

적용 대상