FrustumCamera QML Type
定义了一个带有自定义视锥体的PerspectiveCamera 。更多...
| Import Statement: | import QtQuick3D |
| Inherits: |
属性
详细说明
Camera 定义了 3D 场景的内容如何投影到 2D 表面上,例如View3D 。一个场景至少需要一个Camera 才能将其内容可视化。
Camera 可以像场景中的其他空间Node 一样进行定位和旋转。Node 的位置和方向决定了Camera 在场景中的位置以及其朝向。Camera 的默认方向是:其前向量沿负 Z 轴方向,向上量沿正 Y 轴方向。
FrustumCamera 类型提供了一个PerspectiveCamera ,其中可以自定义视锥体边界。这对于创建非对称视锥体非常有用。
以下示例在场景中的 [0, 0, 100] 位置创建了一个 FrustumCamera。near plane 位于摄像机前方 100 单位处,坐标原点即为其起点。 由此,视锥体与近平面的交点由一个矩形确定,该矩形的左下角位于 [-5, -5],右上角位于 [5, 5],并一直延伸至与远平面(far plane )相交,该平面位于距离摄像机 1000 单位的 [0, 0, -900]处,距离摄像机1000单位。
注: vertical field of view 角度是摄像机与near plane 之间的距离,以及近平面top 与bottom 之间距离的乘积。
注:如果 顶部和底部,或左侧和右侧的值不对称,截锥体的顶点将发生偏移,从而使摄像机相对于其位置发生偏移。
FrustumCamera {
position: Qt.vector3d(0, 0, 100)
clipNear: 100
clipFar: 1000
top: 5
bottom: -5
left: -5
right: 5
}另请参阅 PerspectiveCamera 、OrthographicCamera 和CustomCamera 。
属性文档
bottom : real
bottom 的值指定了near clip plane 的底部,该位置相对于相机在本地坐标系中的位置。
left : real
left 的值指定了near clip plane 的左侧位置,该位置以相机在本地坐标系中的位置为基准。
right : real
right 的值指定了near clip plane 相对于相机在本地坐标系中位置的右侧。
top : real
top 的值指定了near clip plane 的顶部位置,该位置以相机在本地坐标系中的位置为基准。
© 2026 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.