- class QCamera#
-
摘要#
属性#
方法#
def
__init__()def
aspectRatio()def
bottom()def
exposure()def
farPlane()def
fieldOfView()def
left()def
lens()def
nearPlane()def
pan()def
panRotation()def
position()def
projectionType()def
right()def
roll()def
rollRotation()定义
rotate()定义
rotation()定义
tilt()定义
top()定义
transform()定义
translate()定义
upVector()定义
viewCenter()定义
viewMatrix()定义
viewVector()
槽函数#
定义
setBottom()定义
setLeft()定义
setTop()
信号#
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译存在问题,也可以通过在https:/bugreports.qt.io/projects/PYSIDE 上创建工单来通知我们。
详细描述#
- class CameraTranslationOption#
此枚举指定了如何平移相机视图中心。
常量
描述
Qt3DRender.QCamera.TranslateViewCenter
平移动画视图中心,使视图方向保持不变
Qt3DRender.QCamera.DontTranslateViewCenter
不平移视图中心,导致视图方向改变
注意
可以在使用
from __feature__ import true_property时直接使用属性,否则可通过访问器函数使用。- property aspectRatio: float#
持有当前纵横比。
- property bottom: float#
持有相机的当前底部。
当
projectionType为OrthographicProjection时,此属性才相关。- 访问函数
- property exposure: float#
持有相机的当前曝光值。
默认值为 0.0。
Qt 3D Extras 中的 MetalRoughMaterial 是目前唯一提供的利用相机曝光功能的支持材料。负值会使材质变暗,正值会使材质变亮。
自定义材料可以选择不同地解释此值。
- 访问函数
- property farPlane: float#
保持当前摄像机的远裁剪面。距离摄像机比farPlane远的对象将不会被渲染。
- 访问函数
- 属性 fieldOfView: float#
保持当前垂直视场角(以度为单位)。
与
aspectRatio一起,此属性决定了场景中有多少部分对摄像机是可见的。在这方面,您可能认为它类似于选择广角镜头(宽水平视场角)或长焦镜头(窄水平视场角)以捕捉场景的多少。fieldOfView仅在
projectionType是PerspectiveProjection时相关。- 属性 left: float#
保持当前摄像机的左侧。
当
projectionType为OrthographicProjection时,此属性才相关。- 访问函数
- 属性 lens: QCameraLens#
保持摄像机的
QCameraLens组件。- 访问函数
- 属性 nearPlane: float#
保持当前摄像机的近裁剪面。距离摄像机比nearPlane近的对象将不会被渲染。
保持摄像机相对于父实体的坐标位置。
- 访问函数
- 属性 projectionMatrix: QMatrix4x4#
保持当前摄像机的投影矩阵。
- 属性 projectionType: Qt3DRender.QCameraLens.ProjectionType#
保存相机的投影类型。默认值是
透视投影。透视投影- 平行线看起来会逐渐汇聚于远方。物体离相机越远,看起来就越小。正交投影- 平行线保持平行。物体无论距离多远,看起来大小都相同。FrustumProjectionCustomProjection
另请参阅
投影类型- 属性 right: float#
保存相机当前的水平方向。
当
projectionType为OrthographicProjection时,此属性才相关。- 访问函数
- 属性 top: float#
保存相机当前的顶部方向。
当
projectionType为OrthographicProjection时,此属性才相关。- 访问函数
- 属性 transform: QTransform#
保存相机中的
QTransform组件。- 访问函数
保存相机相对于父实体的坐标空间中的向上向量。
向上向量指示相机顶部朝向的方向。想象一下拍照:你定位自己,指向目标,然后左右旋转相机,得到肖像或风景(或角度!)照。upVector 允许你控制这种移动。
- 访问函数
包含相对于父实体坐标系的相机视图中心。
直观地说,viewCenter 是相机指向的位置。
- 属性 viewMatrix: QMatrix4x4#
包含相对于父实体坐标系的相机视图矩阵。
- 访问函数
包含相对于父实体坐标系的相机视图向量。
此向量表示从相机(
position)到其目标(viewCenter)的偏移。- 访问函数
- __init__([parent=None])#
- 参数:
parent –
QNode
创建一个新的
QCamera实例,指定parent。- aspectRatio()#
- 返回类型:
float
另请参阅
setAspectRatio()
属性
aspectRatio的获取器。- aspectRatioChanged(aspectRatio)#
- 参数:
aspectRatio – float
属性
aspectRatio的通知信号。- bottom()#
- 返回类型:
float
另请参阅
setBottom()
属性
bottomᅟ的获取器。- bottomChanged(bottom)#
- 参数:
bottom – 浮点数
属性
bottomᅟ的通知信号。- exposure()#
- 返回类型:
float
另请参阅
setExposure()
属性
exposureᅟ的获取器。- exposureChanged(exposure)#
- 参数:
exposure – 浮点数
属性
exposureᅟ的通知信号。- farPlane()#
- 返回类型:
float
另请参阅
setFarPlane()
属性
farPlaneᅟ的获取器。- farPlaneChanged(farPlane)#
- 参数:
farPlane – 浮点数
属性
farPlaneᅟ的通知信号。- fieldOfView()#
- 返回类型:
float
另请参阅
setFieldOfView()
属性
fieldOfViewᅟ的获取器。- fieldOfViewChanged(fieldOfView)#
- 参数:
fieldOfView – 浮点数
属性
fieldOfViewᅟ的通知信号。- left()#
- 返回类型:
float
另请参阅
setLeft()
属性
leftᅟ的获取器。- leftChanged(left)#
- 参数:
left – 浮点数
属性
leftᅟ的通知信号。- lens()#
- 返回类型:
QCameraLens
返回当前镜头。
属性
lensᅟ的获取器。- nearPlane()#
- 返回类型:
float
另请参阅
setNearPlane()
属性
nearPlaneᅟ的获取器。- nearPlaneChanged(nearPlane)#
- 参数:
nearPlane – float
属性
nearPlaneᅟ的通知信号。- pan(angle)#
- 参数:
angle – float
通过角度
angle调整摄像机的俯仰角度。- pan(angle, axis)
- 参数:
angle – float
axis –
QVector3D
在选定的
axis上以角度angle调整摄像机的俯仰角度。- panAboutViewCenter(angle)#
- 参数:
angle – float
通过角度
angle在视图中调整摄像机。- panAboutViewCenter(angle, axis)
- 参数:
angle – float
axis –
QVector3D
在选定的
axis上通过角度angle在视图中调整摄像机。- panRotation(angle)#
- 参数:
angle – float
- 返回类型:
根据角度
angle返回 Pan 旋转,该角度用于调整摄像机在Y轴上的左/右旋转。属性
positionᅟ的获取器。属性
positionᅟ的通知信号。- projectionMatrix()#
- 返回类型:
另请参阅
设置投影矩阵()
属性 projectionMatrix 的获取器。
- projectionMatrixChanged(projectionMatrix)#
- 参数:
projectionMatrix - QMatrix4x4
属性 projectionMatrix 的通知信号。
- projectionType()#
- 返回类型:
投影类型
另请参阅
setProjectionType()
属性 projectionType 的获取器。
- projectionTypeChanged(projectionType)#
- 参数:
projectionType -
ProjectionType
属性 projectionType 的通知信号。
- right()#
- 返回类型:
float
另请参阅
setRight()
属性 right 的获取器。
- rightChanged(right)#
- 参数:
right - float
属性 right 的通知信号。
- roll(angle)#
- 参数:
angle – float
通过在度为单位中调整角度,改变摄像机的翻滚。
- rollAboutViewCenter(angle)#
- 参数:
angle – float
通过在度为单位中调整角度,在视图中心附近改变摄像机的翻滚。
- rollRotation(angle)#
- 参数:
angle – float
- 返回类型:
根据在度中调整摄像机翻滚或倾斜左/右旋转的角度,返回计算的翻滚旋转。
- rotate(q)#
- 参数:
q –
QQuaternion
使用四元数
q来旋转相机。- rotateAboutViewCenter(q)#
- 参数:
q –
QQuaternion
使用四元数
q来环绕视中心旋转相机。返回基于度数的
angle和选择的方向axis计算出的旋转。- setAspectRatio(aspectRatio)#
- 参数:
aspectRatio – float
设置相机的宽高比为
aspectRatio。另请参阅
aspectRatio()属性
aspectRatio的设置器。- setBottom(bottom)#
- 参数:
bottom – 浮点数
设置相机的底部为
bottom。另请参阅
bottom()属性
bottom的设置器。- setExposure(exposure)#
- 参数:
exposure – 浮点数
设置相机的曝光值为
exposure。另请参阅
exposure()属性
exposure的设置器。- setFarPlane(farPlane)#
- 参数:
farPlane – 浮点数
设置相机的远裁剪面为
farPlane。另请参阅
farPlane()属性
farPlane的设置器。- setFieldOfView(fieldOfView)#
- 参数:
fieldOfView – 浮点数
设置相机的视野范围为
fieldOfView度。另请参阅
fieldOfView()属性
fieldOfView的设置器。- setLeft(left)#
- 参数:
left – 浮点数
将摄像机的左侧设置为
left。另请参阅
left()属性
left属性的设置器。- setNearPlane(nearPlane)#
- 参数:
nearPlane – float
将摄像机的近剪裁面设置为
nearPlane。另请参阅
nearPlane()属性
nearPlane属性的设置器。将摄像机在 3D 空间中的位置设置为
position。另请参阅
position()属性
position属性的设置器。- setProjectionMatrix(projectionMatrix)#
- 参数:
projectionMatrix - QMatrix4x4
将摄像机的投影矩阵设置为
projectionMatrix。另请参阅
projectionMatrix()属性
projectionMatrix属性的设置器。- setProjectionTypetype)#
- 参数:
type –
ProjectionType
将摄像机的投影类型设置为
type。另请参阅
projectionType()属性
projectionType属性的设置器。- setRightright)#
- 参数:
right - float
将摄像机的右侧设置为
right。另请参阅
right()属性
right属性的设置器。- setToptop)#
- 参数:
top – float
将摄像机的顶部设置为
top。另请参阅
top()属性
top属性的设置器。将摄像机的向上向量设置为
upVector。另请参阅
upVector()属性的设置器
upVector setting。将摄像机的视图中心设置为
viewCenter。另请参阅
viewCenter()属性的设置器
viewCenter setting。- tilt(angle)#
- 参数:
angle – float
通过
angle(以度为单位的角)调整摄像机倾斜角度。- tiltAboutViewCenter(angle)#
- 参数:
angle – float
通过
angle(以度为单位的角)调整摄像机相对于视图中心的倾斜。- tiltRotation(angle)#
- 参数:
angle – float
- 返回类型:
返回根据
angle(以度为单位的角)调整摄像机倾斜或X轴上下旋转而计算出的倾斜旋转。- top()#
- 返回类型:
float
另请参阅
setTop()
属性的获取器
top 获取器。- topChanged(top)#
- 参数:
top – float
属性
top 获取器的通知信号。- transform()#
- 返回类型:
QTransform
通过转换返回摄像机的位置。
属性的获取器
transform 获取器。- translate(vLocal[, option=Qt3DRender.QCamera.CameraTranslationOption.TranslateViewCenter])#
- 参数:
vLocal -
QVector3Doption -
CameraTranslationOption
将摄像机位置及其视图向量通过
vLocal(局部坐标)平移。通过option可以切换是否应该平移视图中心。- translateWorld(vWorld[, option=Qt3DRender.QCamera.CameraTranslationOption.TranslateViewCenter])#
- 参数:
vWorld –
QVector3Doption -
CameraTranslationOption
通过世界坐标的
vWorld平移相机位置和它的视图矢量。通过option可以切换是否平移视图中心。属性
upVector的获取器。属性
upVector的状态变更通知信号。- viewAll()#
旋转和移动相机,使其
viewCenter成为场景边界框的中心,并且整个场景适合在视口中。属性
viewCenter的获取器。属性
viewCenter的状态变更通知信号。- viewEntity(entity)#
- 参数:
entity –
QEntity
旋转和移动相机,使其
viewCenter成为entity的边界框的中心,并且整个entity适合在视口中。- viewMatrix()#
- 返回类型:
属性
viewMatrix的获取器。- viewMatrixChanged()#
属性
viewMatrix的状态变更通知信号。旋转和移动相机,使其
viewCenter是center,并且半径为radius的球体完全包含在视口中。属性
viewVectorᅟ的获取器。viewVectorᅟ属性的变更通知信号。