QCamera¶
The
QCamera
class defines a view point through which the scene will be rendered. More…
Synopsis¶
Functions¶
def
aspectRatio
()def
bottom
()def
exposure
()def
farPlane
()def
fieldOfView
()def
left
()def
lens
()def
nearPlane
()def
pan
(angle)def
pan
(angle, axis)def
panAboutViewCenter
(angle)def
panAboutViewCenter
(angle, axis)def
panRotation
(angle)def
position
()def
projectionMatrix
()def
projectionType
()def
right
()def
roll
(angle)def
rollAboutViewCenter
(angle)def
rollRotation
(angle)def
rotate
(q)def
rotateAboutViewCenter
(q)def
rotation
(angle, axis)def
tilt
(angle)def
tiltAboutViewCenter
(angle)def
tiltRotation
(angle)def
top
()def
transform
()def
translate
(vLocal[, option=TranslateViewCenter])def
translateWorld
(vWorld[, option=TranslateViewCenter])def
upVector
()def
viewCenter
()def
viewMatrix
()def
viewVector
()
Slots¶
def
setAspectRatio
(aspectRatio)def
setBottom
(bottom)def
setExposure
(exposure)def
setFarPlane
(farPlane)def
setFieldOfView
(fieldOfView)def
setLeft
(left)def
setNearPlane
(nearPlane)def
setPosition
(position)def
setProjectionMatrix
(projectionMatrix)def
setProjectionType
(type)def
setRight
(right)def
setTop
(top)def
setUpVector
(upVector)def
setViewCenter
(viewCenter)def
viewAll
()def
viewEntity
(entity)def
viewSphere
(center, radius)
Signals¶
def
aspectRatioChanged
(aspectRatio)def
bottomChanged
(bottom)def
exposureChanged
(exposure)def
farPlaneChanged
(farPlane)def
fieldOfViewChanged
(fieldOfView)def
leftChanged
(left)def
nearPlaneChanged
(nearPlane)def
positionChanged
(position)def
projectionMatrixChanged
(projectionMatrix)def
projectionTypeChanged
(projectionType)def
rightChanged
(right)def
topChanged
(top)def
upVectorChanged
(upVector)def
viewCenterChanged
(viewCenter)def
viewMatrixChanged
()def
viewVectorChanged
(viewVector)
Detailed Description¶
- class PySide2.Qt3DRender.Qt3DRender.QCamera([parent=None])¶
- param parent:
Creates a new
QCamera
instance with the specifiedparent
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.CameraTranslationOption¶
This enum specifies how camera view center is translated
Constant
Description
Qt3DRender.QCamera.TranslateViewCenter
Translate the view center causing the view direction to remain the same
Qt3DRender.QCamera.DontTranslateViewCenter
Don’t translate the view center causing the view direction to change
- PySide2.Qt3DRender.Qt3DRender.QCamera.aspectRatio()¶
- Return type:
float
Holds the current aspect ratio.
- PySide2.Qt3DRender.Qt3DRender.QCamera.aspectRatioChanged(aspectRatio)¶
- Parameters:
aspectRatio – float
- PySide2.Qt3DRender.Qt3DRender.QCamera.bottom()¶
- Return type:
float
Holds the current bottom of the camera.
This property is only relevant when
projectionType
isOrthographicProjection
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.bottomChanged(bottom)¶
- Parameters:
bottom – float
- PySide2.Qt3DRender.Qt3DRender.QCamera.exposure()¶
- Return type:
float
Holds the current exposure of the camera.
The default value is 0.0.
The MetalRoughMaterial in Qt 3D Extras is currently the only provided material that makes use of camera exposure. Negative values will cause the material to be darker, and positive values will cause it to be lighter.
Custom materials may choose to interpret the value differently.
- PySide2.Qt3DRender.Qt3DRender.QCamera.exposureChanged(exposure)¶
- Parameters:
exposure – float
- PySide2.Qt3DRender.Qt3DRender.QCamera.farPlane()¶
- Return type:
float
Holds the current camera far plane. Objects that are farther from the camera than the will not be rendered.
- PySide2.Qt3DRender.Qt3DRender.QCamera.farPlaneChanged(farPlane)¶
- Parameters:
farPlane – float
- PySide2.Qt3DRender.Qt3DRender.QCamera.fieldOfView()¶
- Return type:
float
Holds the current vertical field of view in degrees.
Along with
aspectRatio
, this property determines how much of the scene is visible to the camera. In that respect you might think of it as analogous to choosing a wide angle (wide horizontal field of view) or telephoto (narrow horizontal field of view) lens depending on how much of a scene you want to capture.is only relevant when
projectionType
isPerspectiveProjection
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.fieldOfViewChanged(fieldOfView)¶
- Parameters:
fieldOfView – float
- PySide2.Qt3DRender.Qt3DRender.QCamera.left()¶
- Return type:
float
Holds the current left of the camera.
This property is only relevant when
projectionType
isOrthographicProjection
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.leftChanged(left)¶
- Parameters:
left – float
- PySide2.Qt3DRender.Qt3DRender.QCamera.lens()¶
- Return type:
Holds the
QCameraLens
component of the camera.
- PySide2.Qt3DRender.Qt3DRender.QCamera.nearPlane()¶
- Return type:
float
Holds the current camera near plane. Objects that are closer to the camera than the will not be rendered.
- PySide2.Qt3DRender.Qt3DRender.QCamera.nearPlaneChanged(nearPlane)¶
- Parameters:
nearPlane – float
- PySide2.Qt3DRender.Qt3DRender.QCamera.pan(angle)¶
- Parameters:
angle – float
Adjusts the pan angle of the camera by
angle
in degrees.
- PySide2.Qt3DRender.Qt3DRender.QCamera.pan(angle, axis)
- Parameters:
angle – float
axis –
PySide2.QtGui.QVector3D
Adjusts the pan angle of the camera by
angle
in degrees on a chosenaxis
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.panAboutViewCenter(angle)¶
- Parameters:
angle – float
Adjusts the camera pan about view center by
angle
in degrees.
- PySide2.Qt3DRender.Qt3DRender.QCamera.panAboutViewCenter(angle, axis)
- Parameters:
angle – float
axis –
PySide2.QtGui.QVector3D
Adjusts the camera pan about view center by
angle
in degrees onaxis
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.panRotation(angle)¶
- Parameters:
angle – float
- Return type:
Returns the calculated pan rotation in relation to the
angle
in degrees taken in to adjust the camera’s pan or left/right rotation on the Y axis.
- PySide2.Qt3DRender.Qt3DRender.QCamera.position()¶
- Return type:
Holds the camera’s position in coordinates relative to the parent entity.
- PySide2.Qt3DRender.Qt3DRender.QCamera.positionChanged(position)¶
- Parameters:
position –
PySide2.QtGui.QVector3D
- PySide2.Qt3DRender.Qt3DRender.QCamera.projectionMatrix()¶
- Return type:
Holds the current projection matrix of the camera.
- PySide2.Qt3DRender.Qt3DRender.QCamera.projectionMatrixChanged(projectionMatrix)¶
- Parameters:
projectionMatrix –
PySide2.QtGui.QMatrix4x4
- PySide2.Qt3DRender.Qt3DRender.QCamera.projectionType()¶
- Return type:
Holds the type of the camera projection. The default value is
PerspectiveProjection
.OrthographicProjection
- Parallel lines appear parallel. Objects appear the same size regardless of distance.PerspectiveProjection
- Parallel lines appear to meet in the distance. Objects appear to shrink the farther they are from the camera.FrustumProjection
CustomProjection
See also
ProjectionType
- PySide2.Qt3DRender.Qt3DRender.QCamera.projectionTypeChanged(projectionType)¶
- Parameters:
projectionType –
ProjectionType
- PySide2.Qt3DRender.Qt3DRender.QCamera.right()¶
- Return type:
float
Holds the current right of the camera.
This property is only relevant when
projectionType
isOrthographicProjection
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.rightChanged(right)¶
- Parameters:
right – float
- PySide2.Qt3DRender.Qt3DRender.QCamera.roll(angle)¶
- Parameters:
angle – float
Adjusts the camera roll by
angle
in degrees.
- PySide2.Qt3DRender.Qt3DRender.QCamera.rollAboutViewCenter(angle)¶
- Parameters:
angle – float
Adjusts the camera roll about view center by
angle
in degrees.
- PySide2.Qt3DRender.Qt3DRender.QCamera.rollRotation(angle)¶
- Parameters:
angle – float
- Return type:
Returns the calculated roll rotation in relation to the
angle
in degrees taken in to adjust the camera’s roll or lean left/right rotation on the Z axis.
- PySide2.Qt3DRender.Qt3DRender.QCamera.rotate(q)¶
- Parameters:
Rotates the camera with the use of a Quaternion in
q
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.rotateAboutViewCenter(q)¶
- Parameters:
Rotates the camera about the view center with the use of a Quaternion in
q
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.rotation(angle, axis)¶
- Parameters:
angle – float
axis –
PySide2.QtGui.QVector3D
- Return type:
Returns the calculated rotation in relation to the
angle
in degrees and chosenaxis
taken in.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setAspectRatio(aspectRatio)¶
- Parameters:
aspectRatio – float
Holds the current aspect ratio.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setBottom(bottom)¶
- Parameters:
bottom – float
Holds the current bottom of the camera.
This property is only relevant when
projectionType
isOrthographicProjection
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setExposure(exposure)¶
- Parameters:
exposure – float
Holds the current exposure of the camera.
The default value is 0.0.
The MetalRoughMaterial in Qt 3D Extras is currently the only provided material that makes use of camera exposure. Negative values will cause the material to be darker, and positive values will cause it to be lighter.
Custom materials may choose to interpret the value differently.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setFarPlane(farPlane)¶
- Parameters:
farPlane – float
Holds the current camera far plane. Objects that are farther from the camera than the will not be rendered.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setFieldOfView(fieldOfView)¶
- Parameters:
fieldOfView – float
Holds the current vertical field of view in degrees.
Along with
aspectRatio
, this property determines how much of the scene is visible to the camera. In that respect you might think of it as analogous to choosing a wide angle (wide horizontal field of view) or telephoto (narrow horizontal field of view) lens depending on how much of a scene you want to capture.is only relevant when
projectionType
isPerspectiveProjection
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setLeft(left)¶
- Parameters:
left – float
Holds the current left of the camera.
This property is only relevant when
projectionType
isOrthographicProjection
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setNearPlane(nearPlane)¶
- Parameters:
nearPlane – float
Holds the current camera near plane. Objects that are closer to the camera than the will not be rendered.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setPosition(position)¶
- Parameters:
position –
PySide2.QtGui.QVector3D
Holds the camera’s position in coordinates relative to the parent entity.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setProjectionMatrix(projectionMatrix)¶
- Parameters:
projectionMatrix –
PySide2.QtGui.QMatrix4x4
Holds the current projection matrix of the camera.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setProjectionType(type)¶
- Parameters:
type –
ProjectionType
Holds the type of the camera projection. The default value is
PerspectiveProjection
.OrthographicProjection
- Parallel lines appear parallel. Objects appear the same size regardless of distance.PerspectiveProjection
- Parallel lines appear to meet in the distance. Objects appear to shrink the farther they are from the camera.FrustumProjection
CustomProjection
See also
ProjectionType
- PySide2.Qt3DRender.Qt3DRender.QCamera.setRight(right)¶
- Parameters:
right – float
Holds the current right of the camera.
This property is only relevant when
projectionType
isOrthographicProjection
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setTop(top)¶
- Parameters:
top – float
Holds the current top of the camera.
This property is only relevant when
projectionType
isOrthographicProjection
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setUpVector(upVector)¶
- Parameters:
upVector –
PySide2.QtGui.QVector3D
Holds the camera’s up vector in coordinates relative to the parent entity.
The up vector indicates which direction the top of the camera is facing. Think of taking a picture: after positioning yourself and pointing the camera at your target, you might rotate the camera left or right, giving you a portrait or landscape (or angled!) shot. allows you to control this type of movement.
- PySide2.Qt3DRender.Qt3DRender.QCamera.setViewCenter(viewCenter)¶
- Parameters:
viewCenter –
PySide2.QtGui.QVector3D
Holds the camera’s view center in coordinates relative to the parent entity.
Intuitively, the is the location the camera is pointing at.
- PySide2.Qt3DRender.Qt3DRender.QCamera.tilt(angle)¶
- Parameters:
angle – float
Adjusts the tilt angle of the camera by
angle
in degrees.
- PySide2.Qt3DRender.Qt3DRender.QCamera.tiltAboutViewCenter(angle)¶
- Parameters:
angle – float
Adjusts the camera tilt about view center by
angle
in degrees.
- PySide2.Qt3DRender.Qt3DRender.QCamera.tiltRotation(angle)¶
- Parameters:
angle – float
- Return type:
Returns the calculated tilt rotation in relation to the
angle
in degrees taken in to adjust the camera’s tilt or up/down rotation on the X axis.
- PySide2.Qt3DRender.Qt3DRender.QCamera.top()¶
- Return type:
float
Holds the current top of the camera.
This property is only relevant when
projectionType
isOrthographicProjection
.
- PySide2.Qt3DRender.Qt3DRender.QCamera.topChanged(top)¶
- Parameters:
top – float
- PySide2.Qt3DRender.Qt3DRender.QCamera.transform()¶
- Return type:
Holds the
QTransform
component of the camera.
- PySide2.Qt3DRender.Qt3DRender.QCamera.translate(vLocal[, option=TranslateViewCenter])¶
- Parameters:
vLocal –
PySide2.QtGui.QVector3D
option –
CameraTranslationOption
Translates the camera’s position and its view vector by
vLocal
in local coordinates. Theoption
allows for toggling whether the view center should be translated.
- PySide2.Qt3DRender.Qt3DRender.QCamera.translateWorld(vWorld[, option=TranslateViewCenter])¶
- Parameters:
vWorld –
PySide2.QtGui.QVector3D
option –
CameraTranslationOption
Translates the camera’s position and its view vector by
vWorld
in world coordinates. Theoption
allows for toggling whether the view center should be translated.
- PySide2.Qt3DRender.Qt3DRender.QCamera.upVector()¶
- Return type:
Holds the camera’s up vector in coordinates relative to the parent entity.
The up vector indicates which direction the top of the camera is facing. Think of taking a picture: after positioning yourself and pointing the camera at your target, you might rotate the camera left or right, giving you a portrait or landscape (or angled!) shot. allows you to control this type of movement.
- PySide2.Qt3DRender.Qt3DRender.QCamera.upVectorChanged(upVector)¶
- Parameters:
upVector –
PySide2.QtGui.QVector3D
- PySide2.Qt3DRender.Qt3DRender.QCamera.viewAll()¶
Rotates and moves the camera so that it’s
viewCenter
is the center of the scene’s bounding volume and the entire scene fits in the view port.Note
Only works if the lens is in perspective or orthographic projection mode.
See also
Qt3D.Render::Camera::projectionType
- PySide2.Qt3DRender.Qt3DRender.QCamera.viewCenter()¶
- Return type:
Holds the camera’s view center in coordinates relative to the parent entity.
Intuitively, the is the location the camera is pointing at.
- PySide2.Qt3DRender.Qt3DRender.QCamera.viewCenterChanged(viewCenter)¶
- Parameters:
viewCenter –
PySide2.QtGui.QVector3D
- PySide2.Qt3DRender.Qt3DRender.QCamera.viewEntity(entity)¶
- Parameters:
entity –
PySide2.Qt3DCore.Qt3DCore.QEntity
Rotates and moves the camera so that it’s
viewCenter
is the center of theentity
‘s bounding volume and the entire entity fits in the view port.Note
Only works if the lens is in perspective or orthographic projection mode.
See also
Camera.projectionType
- PySide2.Qt3DRender.Qt3DRender.QCamera.viewMatrix()¶
- Return type:
Holds the camera’s view matrix in coordinates relative to the parent entity.
- PySide2.Qt3DRender.Qt3DRender.QCamera.viewMatrixChanged()¶
- PySide2.Qt3DRender.Qt3DRender.QCamera.viewSphere(center, radius)¶
- Parameters:
center –
PySide2.QtGui.QVector3D
radius – float
Rotates and moves the camera so that it’s
viewCenter
iscenter
and a sphere ofradius
fits in the view port.Note
Only works if the lens is in perspective or orthographic projection mode.
See also
Qt3D.Render::Camera::projectionType
- PySide2.Qt3DRender.Qt3DRender.QCamera.viewVector()¶
- Return type:
Holds the camera’s view vector in coordinates relative to the parent entity.
This vector decribes the displacement from the camera (
position
) to its target (viewCenter
).
- PySide2.Qt3DRender.Qt3DRender.QCamera.viewVectorChanged(viewVector)¶
- Parameters:
viewVector –
PySide2.QtGui.QVector3D
© 2022 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.