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