PySide6.Qt3DRender.Qt3DRender.QCameraLens¶
- class QCameraLens¶
QCameraLens指定了将用于定义3D场景中相机的投影矩阵。更多…概要¶
属性¶
方法¶
def
__init__()def
aspectRatio()def
bottom()def
exposure()def
farPlane()def
fieldOfView()def
left()def
nearPlane()def
projectionType()def
right()def
top()def
viewAll()def
viewEntity()
插槽¶
def
setAspectRatio()def
setBottom()def
setExposure()def
setFarPlane()def
setFieldOfView()def
setLeft()def
setNearPlane()def
setRight()def
setTop()
信号¶
def
bottomChanged()def
leftChanged()def
rightChanged()def
topChanged()def
viewSphere()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
- class ProjectionType¶
指定用于计算投影矩阵的
QCameraLens参数。常量
描述
Qt3DRender.QCameraLens.OrthographicProjection
正交投影
Qt3DRender.QCameraLens.PerspectiveProjection
透视投影
Qt3DRender.QCameraLens.FrustumProjection
视锥投影
Qt3DRender.QCameraLens.CustomProjection
自定义用户定义的投影
注意
当使用
from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。- property aspectRatioᅟ: float¶
保持相机镜头的当前宽高比。
注意
: 如果投影类型不是
PerspectiveProjection,返回值可能未定义。- Access functions:
- property bottomᅟ: float¶
保持相机镜头的当前底部平面。
注意
如果投影类型是
PerspectiveProjection,返回值可能未定义。- Access functions:
- property exposureᅟ: float¶
保持相机镜头的当前曝光。
- Access functions:
- property farPlaneᅟ: float¶
保存相机镜头的当前近平面。
- Access functions:
- property fieldOfViewᅟ: float¶
保存相机镜头的当前视野。
注意
: 如果投影类型不是
PerspectiveProjection,返回值可能未定义。- Access functions:
- property leftᅟ: float¶
保存相机镜头的当前左平面。
注意
如果投影类型是
PerspectiveProjection,返回值可能未定义。- Access functions:
- property nearPlaneᅟ: float¶
保存相机镜头的当前近平面。
- Access functions:
- property projectionMatrixᅟ: QMatrix4x4¶
保存相机镜头的当前投影矩阵。
- Access functions:
- property projectionTypeᅟ: Qt3DRender.QCameraLens.ProjectionType¶
保存相机投影的类型。
另请参阅
ProjectionType- Access functions:
- property rightᅟ: float¶
保存相机镜头的当前右平面。
注意
如果投影类型是
PerspectiveProjection,返回值可能未定义。- Access functions:
- property topᅟ: float¶
保持相机镜头的当前顶部平面。
注意
如果投影类型是
PerspectiveProjection,返回值可能未定义。- Access functions:
- __init__([parent=None])¶
- Parameters:
parent –
QNode
使用给定的
parent构造一个QCameraLens- 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ᅟ的通知信号。- nearPlane()¶
- Return type:
浮点数
另请参阅
setNearPlane()
属性
nearPlaneᅟ的获取器。- nearPlaneChanged(nearPlane)¶
- Parameters:
nearPlane – 浮点数
属性
nearPlaneᅟ的通知信号。- 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ᅟ的通知信号。- setAspectRatio(aspectRatio)¶
- Parameters:
aspectRatio – 浮点数
将投影的宽高比设置为
aspectRatio。这将触发投影矩阵的更新。注意
如果投影类型不是
PerspectiveProjection,则此操作无效。另请参阅
aspectRatio()属性
aspectRatioᅟ的设置器。- setBottom(bottom)¶
- Parameters:
底部 – 浮点数
将投影的底部窗口坐标设置为
bottom。这将触发投影矩阵的更新。注意
如果投影类型是
PerspectiveProjection,则此操作无效。另请参阅
bottom()属性
bottomᅟ的设置器。- setExposure(exposure)¶
- Parameters:
曝光 – float
设置相机镜头的
曝光另请参阅
exposure()属性
exposureᅟ的设置器。- setFarPlane(farPlane)¶
- Parameters:
farPlane – 浮点数
将投影的远平面设置为
farPlane。这将触发投影矩阵的更新。另请参阅
farPlane()属性
farPlaneᅟ的设置器。- setFieldOfView(fieldOfView)¶
- Parameters:
fieldOfView – 浮点数
将投影的视野设置为
fieldOfView度。这将触发投影矩阵的更新。注意
如果投影类型不是
PerspectiveProjection,则此操作无效。另请参阅
fieldOfView()属性
fieldOfViewᅟ的设置器。- setFrustumProjection(left, right, bottom, top, nearPlane, farPlane)¶
- Parameters:
left – 浮点数
right – 浮点数
bottom – 浮点数
top – 浮点数
nearPlane – 浮点数
farPlane – float
基于
left、right、bottom、top、nearPlane、farPlane定义一个正交投影。- setLeft(left)¶
- Parameters:
left – 浮点数
将投影的左下窗口坐标设置为
left。这将触发投影矩阵的更新。注意
如果投影类型是
PerspectiveProjection,则此操作无效。另请参阅
left()属性
leftᅟ的设置器。- setNearPlane(nearPlane)¶
- Parameters:
nearPlane – 浮点数
将投影的近平面设置为
nearPlane。这会触发投影矩阵的更新。另请参阅
nearPlane()属性
nearPlaneᅟ的设置器。- setOrthographicProjection(left, right, bottom, top, nearPlane, farPlane)¶
- Parameters:
left – 浮点数
right – 浮点数
bottom – 浮点数
top – 浮点数
nearPlane – 浮点数
farPlane – float
基于
left、right、bottom、top、nearPlane、farPlane定义一个正交投影。- setPerspectiveProjection(fieldOfView, aspect, nearPlane, farPlane)¶
- Parameters:
fieldOfView – 浮点数
aspect – 浮点数
nearPlane – 浮点数
farPlane – float
基于
fieldOfView、aspectRatio、nearPlane、farPlane定义一个透视投影。- setProjectionMatrix(projectionMatrix)¶
- Parameters:
projectionMatrix –
QMatrix4x4
将项目矩阵设置为
projectionMatrix。注意
这将把投影类型设置为
CustomProjection,从而忽略所有可能已指定的其他相机参数。另请参阅
projectionMatrix()属性
projectionMatrixᅟ的设置器。- setProjectionType(projectionType)¶
- Parameters:
projectionType –
ProjectionType
设置镜头的投影类型
projectionType。注意
Qt3DRender::QCameraLens::Frustum 和
PerspectiveProjection是指定相同投影的两种不同方式。另请参阅
projectionType()属性
projectionTypeᅟ的设置器。- setRight(right)¶
- Parameters:
right – 浮点数
将投影的右上窗口坐标设置为
right。这将触发投影矩阵的更新。注意
如果投影类型是
PerspectiveProjection,则此操作无效。另请参阅
right()属性
rightᅟ的设置器。- setTop(top)¶
- Parameters:
顶部 – 浮点数
将投影的顶部窗口坐标设置为
top。这将触发投影矩阵的更新。注意
如果投影类型是
PerspectiveProjection,则此操作无效。另请参阅
top()属性
topᅟ的设置器。- top()¶
- Return type:
浮点数
另请参阅
setTop()
属性
topᅟ的获取器。- topChanged(top)¶
- Parameters:
顶部 – 浮点数
属性
topᅟ的通知信号。- viewAll(cameraId)¶
- Parameters:
cameraId –
QNodeId
- viewEntity(entityId, cameraId)¶
- Parameters:
entityId –
QNodeIdcameraId –
QNodeId