class QCameraLens

QCameraLens specifies the projection matrix that will be used to define a Camera for a 3D scene. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QCameraLens

Synopsis

Properties

Methods

Slots

Signals

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

class ProjectionType

Specifies which parameters of QCameraLens are used to compute the projection matrix.

Constant

Description

Qt3DRender.QCameraLens.OrthographicProjection

Orthogonal projection

Qt3DRender.QCameraLens.PerspectiveProjection

Perspective projection

Qt3DRender.QCameraLens.FrustumProjection

Frustum projection

Qt3DRender.QCameraLens.CustomProjection

Custom user-defined projection

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property aspectRatioᅟ: float

Holds the current aspect ratio of the camera lens.

Note

: The return value may be undefined if the projection type is not PerspectiveProjection .

Access functions:
property bottomᅟ: float

Holds the current bottom plane of the camera lens.

Note

The return value may be undefined if the projection type is PerspectiveProjection .

Access functions:
property exposureᅟ: float

Holds the current exposure of the camera lens.

Access functions:
property farPlaneᅟ: float

Holds the current near plane of the camera lens.

Access functions:
property fieldOfViewᅟ: float

Holds the current field of view of the camera lens.

Note

: The return value may be undefined if the projection type is not PerspectiveProjection .

Access functions:
property leftᅟ: float

Holds the current left plane of the camera lens.

Note

The return value may be undefined if the projection type is PerspectiveProjection .

Access functions:
property nearPlaneᅟ: float

Holds the current near plane of the camera lens.

Access functions:
property projectionMatrixᅟ: QMatrix4x4

Holds the current projection matrix of the camera lens.

Access functions:
property projectionTypeᅟ: Qt3DRender.QCameraLens.ProjectionType

Holds the type of the camera projection.

See also

ProjectionType

Access functions:
property rightᅟ: float

Holds the current right plane of the camera lens.

Note

The return value may be undefined if the projection type is PerspectiveProjection .

Access functions:
property topᅟ: float

Holds the current top plane of the camera lens.

Note

The return value may be undefined if the projection type is PerspectiveProjection .

Access functions:
__init__([parent=None])
Parameters:

parentQNode

Constructs a QCameraLens with given parent

aspectRatio()
Return type:

float

See also

setAspectRatio()

Getter of property aspectRatioᅟ .

aspectRatioChanged(aspectRatio)
Parameters:

aspectRatio – float

Notification signal of property aspectRatioᅟ .

bottom()
Return type:

float

See also

setBottom()

Getter of property bottomᅟ .

bottomChanged(bottom)
Parameters:

bottom – float

Notification signal of property bottomᅟ .

exposure()
Return type:

float

See also

setExposure()

Getter of property exposureᅟ .

exposureChanged(exposure)
Parameters:

exposure – float

Notification signal of property exposureᅟ .

farPlane()
Return type:

float

See also

setFarPlane()

Getter of property farPlaneᅟ .

farPlaneChanged(farPlane)
Parameters:

farPlane – float

Notification signal of property farPlaneᅟ .

fieldOfView()
Return type:

float

See also

setFieldOfView()

Getter of property fieldOfViewᅟ .

fieldOfViewChanged(fieldOfView)
Parameters:

fieldOfView – float

Notification signal of property fieldOfViewᅟ .

left()
Return type:

float

See also

setLeft()

Getter of property leftᅟ .

leftChanged(left)
Parameters:

left – float

Notification signal of property leftᅟ .

nearPlane()
Return type:

float

See also

setNearPlane()

Getter of property nearPlaneᅟ .

nearPlaneChanged(nearPlane)
Parameters:

nearPlane – float

Notification signal of property nearPlaneᅟ .

projectionMatrix()
Return type:

QMatrix4x4

See also

setProjectionMatrix()

Getter of property projectionMatrixᅟ .

projectionMatrixChanged(projectionMatrix)
Parameters:

projectionMatrixQMatrix4x4

Notification signal of property projectionMatrixᅟ .

projectionType()
Return type:

ProjectionType

See also

setProjectionType()

Getter of property projectionTypeᅟ .

projectionTypeChanged(projectionType)
Parameters:

projectionTypeProjectionType

Notification signal of property projectionTypeᅟ .

right()
Return type:

float

See also

setRight()

Getter of property rightᅟ .

rightChanged(right)
Parameters:

right – float

Notification signal of property rightᅟ .

setAspectRatio(aspectRatio)
Parameters:

aspectRatio – float

Sets the projection’s aspect ratio to aspectRatio. This triggers a projection matrix update.

Note

this has no effect if the projection type is not PerspectiveProjection .

See also

aspectRatio()

Setter of property aspectRatioᅟ .

setBottom(bottom)
Parameters:

bottom – float

Sets the projection’s bottom window coordinate to bottom. This triggers a projection matrix update.

Note

this has no effect if the projection type is PerspectiveProjection .

See also

bottom()

Setter of property bottomᅟ .

setExposure(exposure)
Parameters:

exposure – float

Sets the camera lens’ exposure

See also

exposure()

Setter of property exposureᅟ .

setFarPlane(farPlane)
Parameters:

farPlane – float

Sets the projection’s far plane to farPlane. This triggers a projection matrix update.

See also

farPlane()

Setter of property farPlaneᅟ .

setFieldOfView(fieldOfView)
Parameters:

fieldOfView – float

Sets the projection’s field of view to fieldOfView degrees. This triggers a projection matrix update.

Note

this has no effect if the projection type is not PerspectiveProjection .

See also

fieldOfView()

Setter of property fieldOfViewᅟ .

setFrustumProjection(left, right, bottom, top, nearPlane, farPlane)
Parameters:
  • left – float

  • right – float

  • bottom – float

  • top – float

  • nearPlane – float

  • farPlane – float

Defines an orthographic projection based on left, right, bottom, top, nearPlane, farPlane.

setLeft(left)
Parameters:

left – float

Sets the projection’s lower left window coordinate to left. This triggers a projection matrix update.

Note

this has no effect if the projection type is PerspectiveProjection .

See also

left()

Setter of property leftᅟ .

setNearPlane(nearPlane)
Parameters:

nearPlane – float

Sets the projection’s near plane to nearPlane. This triggers a projection matrix update.

See also

nearPlane()

Setter of property nearPlaneᅟ .

setOrthographicProjection(left, right, bottom, top, nearPlane, farPlane)
Parameters:
  • left – float

  • right – float

  • bottom – float

  • top – float

  • nearPlane – float

  • farPlane – float

Defines an orthographic projection based on left, right, bottom, top, nearPlane, farPlane.

setPerspectiveProjection(fieldOfView, aspect, nearPlane, farPlane)
Parameters:
  • fieldOfView – float

  • aspect – float

  • nearPlane – float

  • farPlane – float

Defines a perspective projection based on fieldOfView, aspectRatio, nearPlane, farPlane.

setProjectionMatrix(projectionMatrix)
Parameters:

projectionMatrixQMatrix4x4

Sets the project matrix to projectionMatrix.

Note

This will set the projection type to CustomProjection and thus ignore all other camera parameters that might have been specified.

See also

projectionMatrix()

Setter of property projectionMatrixᅟ .

setProjectionType(projectionType)
Parameters:

projectionTypeProjectionType

Sets the lens’ projection type projectionType.

Note

Qt3DRender::QCameraLens::Frustum and PerspectiveProjection are two different ways of specifying the same projection.

See also

projectionType()

Setter of property projectionTypeᅟ .

setRight(right)
Parameters:

right – float

Sets the projection’s upper right window coordinate to right. This triggers a projection matrix update.

Note

this has no effect if the projection type is PerspectiveProjection .

See also

right()

Setter of property rightᅟ .

setTop(top)
Parameters:

top – float

Sets the projection’s top window coordinate to top. This triggers a projection matrix update.

Note

this has no effect if the projection type is PerspectiveProjection .

See also

top()

Setter of property topᅟ .

top()
Return type:

float

See also

setTop()

Getter of property topᅟ .

topChanged(top)
Parameters:

top – float

Notification signal of property topᅟ .

viewAll(cameraId)
Parameters:

cameraIdQNodeId

viewEntity(entityId, cameraId)
Parameters:
  • entityIdQNodeId

  • cameraIdQNodeId

viewSphere(center, radius)
Parameters: