PerspectiveCamera QML Type

定义用于查看 3D 场景内容的透视相机。更多

Import Statement: import QtQuick3D
Inherits:

Camera

Inherited By:

FrustumCamera

属性

详细说明

Camera 定义了如何将三维场景的内容投射到二维表面(如View3D )上。一个场景至少需要一个Camera 才能将其内容可视化。

可以像场景中其他空间Node 一样定位和旋转CameraNode 的位置和方向决定了Camera 在场景中的位置和朝向。Camera 的默认方向是向前矢量沿负 Z 轴指向,向上矢量沿正 Y 轴指向。

透视摄像机(PerspectiveCamera)是标准的Camera 类型。它能提供逼真的场景投影,远处的物体会被认为变小。视场角由fieldOfView 属性以及远近剪辑平面定义。

以下示例在场景中的 [0, 200, 300] 位置创建了一个透视摄像机,视场角为 90 度,俯仰角为 30 度。

PerspectiveCamera {
    position: Qt.vector3d(0, 200, 300)
    eulerRotation.x: -30
    fieldOfView: 90
}

另请参阅 Qt Quick 3D - View3D 示例OrthographicCamera,FrustumCameraCustomCamera

属性文档

clipFar : real

该属性定义了PerspectiveCamera 图元的远夹平面。距离Camera 远于远夹平面的几何体将不可见。

默认值为 10000.0。单位取决于用户的几何图形单位,数值相对于全局摄像机位置。


clipNear : real

该属性定义了PerspectiveCamera 的近剪辑平面。距离Camera 比近夹平面更近的几何体将不可见。

默认值为 10.0。单位取决于用户的几何图形单位,数值相对于全局摄像机位置。


fieldOfView : real

该属性表示摄像机的视场角,单位为度。视fieldOfViewOrientation 属性设置为PerspectiveCamera.Vertical 还是PerspectiveCamera.Horizontal 而定,它可以是垂直视场,也可以是水平视场。

默认值为 60.0。


fieldOfViewOrientation : enumeration

该属性表示摄像机视场的方向。

常数说明
PerspectiveCamera.Vertical所提供的视场是垂直的,即视场是从摄像机到视口中心顶部的直线与从摄像机到视口中心底部的直线之间的夹角。水平纵横比将进行调整以保持纵横比。
PerspectiveCamera.Horizontal所提供的视场是水平的,即视场是指从摄像机追踪到视口左侧中心的线与从摄像机追踪到视口右侧中心的线之间的角度。垂直纵横比将进行调整以保持纵横比。

默认值为PerspectiveCamera.Vertical


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.