Qt3DRender::QCamera Class
class Qt3DRender::QCameraQCamera 클래스는 장면이 렌더링될 시점을 정의합니다. 더 보기...
| 헤더: | #include <Qt3DRender/QCamera> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
| qmake: | QT += 3drender |
| QML에서: | Camera |
| 상속: | Qt3DCore::QEntity |
| 상태: | 사용 중단됨 |
이 클래스는 더 이상 사용되지 않습니다. 새로운 코드에서는 이 클래스를 사용하지 않는 것을 강력히 권장합니다.
공개 유형
| enum | CameraTranslationOption { TranslateViewCenter, DontTranslateViewCenter } |
속성
|
|
공개 함수
| QCamera(Qt3DCore::QNode *parent = nullptr) | |
| float | aspectRatio() const |
| float | bottom() const |
| float | exposure() const |
| float | farPlane() const |
| float | fieldOfView() const |
| float | left() const |
| Qt3DRender::QCameraLens * | lens() const |
| float | nearPlane() const |
| void | pan(float angle) |
| void | pan(float angle, const QVector3D &axis) |
| void | panAboutViewCenter(float angle) |
| void | panAboutViewCenter(float angle, const QVector3D &axis) |
| QQuaternion | panRotation(float angle) const |
| QVector3D | position() const |
| QMatrix4x4 | projectionMatrix() const |
| Qt3DRender::QCameraLens::ProjectionType | projectionType() const |
| float | right() const |
| void | roll(float angle) |
| void | rollAboutViewCenter(float angle) |
| QQuaternion | rollRotation(float angle) const |
| void | rotate(const QQuaternion &q) |
| void | rotateAboutViewCenter(const QQuaternion &q) |
| QQuaternion | rotation(float angle, const QVector3D &axis) const |
| void | tilt(float angle) |
| void | tiltAboutViewCenter(float angle) |
| QQuaternion | tiltRotation(float angle) const |
| float | top() const |
| Qt3DCore::QTransform * | transform() const |
| void | translate(const QVector3D &vLocal, Qt3DRender::QCamera::CameraTranslationOption option = TranslateViewCenter) |
| void | translateWorld(const QVector3D &vWorld, Qt3DRender::QCamera::CameraTranslationOption option = TranslateViewCenter) |
| QVector3D | upVector() const |
| QVector3D | viewCenter() const |
| QVector3D | viewVector() const |
공개 슬롯
| void | setAspectRatio(float aspectRatio) |
| void | setBottom(float bottom) |
| void | setExposure(float exposure) |
| void | setFarPlane(float farPlane) |
| void | setFieldOfView(float fieldOfView) |
| void | setLeft(float left) |
| void | setNearPlane(float nearPlane) |
| void | setPosition(const QVector3D &position) |
| void | setProjectionMatrix(const QMatrix4x4 &projectionMatrix) |
| void | setProjectionType(Qt3DRender::QCameraLens::ProjectionType type) |
| void | setRight(float right) |
| void | setTop(float top) |
| void | setUpVector(const QVector3D &upVector) |
| void | setViewCenter(const QVector3D &viewCenter) |
| void | viewAll() |
| void | viewEntity(Qt3DCore::QEntity *entity) |
| void | viewSphere(const QVector3D ¢er, float radius) |
신호
| void | aspectRatioChanged(float aspectRatio) |
| void | bottomChanged(float bottom) |
| void | exposureChanged(float exposure) |
| void | farPlaneChanged(float farPlane) |
| void | fieldOfViewChanged(float fieldOfView) |
| void | leftChanged(float left) |
| void | nearPlaneChanged(float nearPlane) |
| void | positionChanged(const QVector3D &position) |
| void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix) |
| void | projectionTypeChanged(Qt3DRender::QCameraLens::ProjectionType projectionType) |
| void | rightChanged(float right) |
| void | topChanged(float top) |
| void | upVectorChanged(const QVector3D &upVector) |
| void | viewCenterChanged(const QVector3D &viewCenter) |
| void | viewVectorChanged(const QVector3D &viewVector) |
멤버 유형 설명
enum QCamera::CameraTranslationOption
이 열거형은 카메라 시점 중심이 어떻게 변환되는지를 지정합니다
| 상수 | 값 | 설명 |
|---|---|---|
Qt3DRender::QCamera::TranslateViewCenter | 0 | 뷰 중심을 이동하되 뷰 방향은 그대로 유지합니다. |
Qt3DRender::QCamera::DontTranslateViewCenter | 1 | 뷰 중심을 이동하지 않아 뷰 방향이 변경되도록 합니다 |
속성 설명
aspectRatio : float
현재 화면 비율을 유지합니다.
액세스 함수:
| float | aspectRatio() const |
| void | setAspectRatio(float aspectRatio) |
알림 신호:
| void | aspectRatioChanged(float aspectRatio) |
bottom : float
카메라의 현재 하단 위치를 저장합니다.
이 속성은 ` projectionType `가 ` QCameraLens::OrthographicProjection`일 때만 적용됩니다.
액세스 함수:
| float | bottom() const |
| void | setBottom(float bottom) |
알림 신호:
| void | bottomChanged(float bottom) |
exposure : float
카메라의 현재 노출 값을 저장합니다.
기본값은 0.0입니다.
Qt 3D Extras에 포함된 MetalRoughMaterial은 현재 카메라 노출을 활용하는 유일한 제공된 머티리얼입니다. 음수 값을 설정하면 머티리얼이 더 어두워지고, 양수 값을 설정하면 더 밝아집니다.
사용자 정의 머티리얼은 이 값을 다르게 해석하도록 선택할 수 있습니다.
액세스 함수:
| float | exposure() const |
| void | setExposure(float exposure) |
알림 신호:
| void | exposureChanged(float exposure) |
farPlane : float
현재 카메라의 원거리 평면을 저장합니다. farPlane보다 카메라에서 더 멀리 떨어진 오브젝트는 렌더링되지 않습니다.
액세스 함수:
| float | farPlane() const |
| void | setFarPlane(float farPlane) |
알림 신호:
| void | farPlaneChanged(float farPlane) |
fieldOfView : float
현재의 수직 시야각을 도(°) 단위로 저장합니다.
aspectRatio 와 함께, 이 속성은 카메라에 얼마나 많은 장면이 보이는지를 결정합니다. 이러한 측면에서, 이 속성은 촬영하고자 하는 장면의 범위에 따라 광각 렌즈(넓은 수평 시야각)나 망원 렌즈(좁은 수평 시야각)를 선택하는 것과 유사하다고 생각할 수 있습니다.
fieldOfView는 projectionType 가 QCameraLens::PerspectiveProjection 일 때만 적용됩니다.
액세스 함수:
| float | fieldOfView() const |
| void | setFieldOfView(float fieldOfView) |
Notifier 신호:
| void | fieldOfViewChanged(float fieldOfView) |
left : float
카메라의 현재 좌측 위치를 저장합니다.
이 속성은 ` projectionType `가 ` QCameraLens::OrthographicProjection`일 때만 적용됩니다.
액세스 함수:
| float | left() const |
| void | setLeft(float left) |
알림 신호:
| void | leftChanged(float left) |
[read-only] lens : Qt3DRender::QCameraLens* const
카메라의 Qt3DRender::QCameraLens 컴포넌트를 보유합니다.
액세스 함수:
| Qt3DRender::QCameraLens * | lens() const |
nearPlane : float
현재 카메라의 근접 평면을 설정합니다. nearPlane보다 카메라에 더 가까운 오브젝트는 렌더링되지 않습니다.
액세스 함수:
| float | nearPlane() const |
| void | setNearPlane(float nearPlane) |
알림 신호:
| void | nearPlaneChanged(float nearPlane) |
position : QVector3D
카메라의 위치를 부모 엔티티를 기준으로 한 좌표계에서 고정합니다.
액세스 함수:
| QVector3D | position() const |
| void | setPosition(const QVector3D &position) |
알림 신호:
| void | positionChanged(const QVector3D &position) |
projectionMatrix : QMatrix4x4
카메라의 현재 투영 행렬을 저장합니다.
액세스 함수:
| QMatrix4x4 | projectionMatrix() const |
| void | setProjectionMatrix(const QMatrix4x4 &projectionMatrix) |
알림 신호:
| void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix) |
projectionType : Qt3DRender::QCameraLens::ProjectionType
카메라 투영의 유형을 저장합니다. 기본값은 ‘ QCameraLens::PerspectiveProjection ’입니다.
- QCameraLens::OrthographicProjection - 평행선은 평행하게 보입니다. 물체는 거리와 관계없이 같은 크기로 보입니다.
- QCameraLens::PerspectiveProjection - 평행선은 멀리서 만나게 보입니다. 물체는 카메라에서 멀어질수록 작아 보이는 효과가 나타납니다.
- QCameraLens::FrustumProjection
- QCameraLens::CustomProjection
액세스 함수:
| Qt3DRender::QCameraLens::ProjectionType | projectionType() const |
| void | setProjectionType(Qt3DRender::QCameraLens::ProjectionType type) |
알림 신호:
| void | projectionTypeChanged(Qt3DRender::QCameraLens::ProjectionType projectionType) |
Qt3DRender::QCameraLens::ProjectionType도 참조하십시오 .
right : float
카메라의 현재 권한을 보유합니다.
이 속성은 ` projectionType `가 ` QCameraLens::OrthographicProjection`인 경우에만 적용됩니다.
액세스 함수:
| float | right() const |
| void | setRight(float right) |
알림 신호:
| void | rightChanged(float right) |
top : float
카메라의 현재 상단 위치를 저장합니다.
이 속성은 ` projectionType `가 ` QCameraLens::OrthographicProjection`인 경우에만 적용됩니다.
액세스 함수:
| float | top() const |
| void | setTop(float top) |
알림 신호:
| void | topChanged(float top) |
[read-only] transform : Qt3DCore::QTransform* const
카메라의 Qt3DCore::QTransform 구성 요소를 보관합니다.
액세스 함수:
| Qt3DCore::QTransform * | transform() const |
upVector : QVector3D
부모 엔티티를 기준으로 한 좌표계에서 카메라의 상향 벡터를 저장합니다.
up 벡터는 카메라 상단이 향하고 있는 방향을 나타냅니다. 사진을 찍는 상황을 생각해 보세요. 위치를 잡고 카메라를 피사체에 맞춘 후, 카메라를 좌우로 회전시켜 세로 사진이나 가로 사진(혹은 비스듬한 각도의 사진!)을 찍을 수 있습니다. upVector를 사용하면 이러한 움직임을 제어할 수 있습니다.
액세스 함수:
| QVector3D | upVector() const |
| void | setUpVector(const QVector3D &upVector) |
Notifier 신호:
| void | upVectorChanged(const QVector3D &upVector) |
viewCenter : QVector3D
카메라의 시야 중심을 상위 엔티티를 기준으로 한 좌표계에 고정합니다.
직관적으로 말하면, viewCenter는 카메라가 향하고 있는 위치입니다.
액세스 함수:
| QVector3D | viewCenter() const |
| void | setViewCenter(const QVector3D &viewCenter) |
Notifier 시그널:
| void | viewCenterChanged(const QVector3D &viewCenter) |
[read-only] viewVector : QVector3D
카메라의 시선 벡터를 부모 엔티티를 기준으로 한 좌표계에서 저장합니다.
이 벡터는 카메라(position)에서 대상(viewCenter)까지의 변위를 나타냅니다.
액세스 함수:
| QVector3D | viewVector() const |
알림 신호:
| void | viewVectorChanged(const QVector3D &viewVector) |
멤버 함수 문서
[explicit] QCamera::QCamera(Qt3DCore::QNode *parent = nullptr)
지정된 ` parent`를 사용하여 새로운 `QCamera` 인스턴스를 생성합니다.
Qt3DRender::QCameraLens *QCamera::lens() const
현재 렌즈를 반환합니다.
참고: lens 속성의게터 함수입니다.
[invokable] void QCamera::pan(float angle)
카메라의 팬 각도를 angle 만큼(도 단위) 조정합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QCamera::pan(float angle, const QVector3D &axis)
선택한 axis 에 대해 카메라의 팬 각도를 angle 만큼(도 단위) 조정합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QCamera::panAboutViewCenter(float angle)
뷰 중심을 기준으로 카메라의 팬 각도를 angle 만큼(도 단위) 조정합니다.
참고: 이 함수는 메타 객체 시스템 및 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QCamera::panAboutViewCenter(float angle, const QVector3D &axis)
axis 를 기준으로 뷰 중심을 중심으로 카메라의 팬 각도를 angle 도만큼 조정합니다.
참고: 이 함수는 메타 객체 시스템 및 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하십시오.
[invokable] QQuaternion QCamera::panRotation(float angle) const
angle 를 기준으로 계산된 팬 회전 각도를 도 단위로 반환하며, 이 값을 사용하여 카메라의 팬 또는 Y축을 따른 좌우 회전을 조정할 수 있습니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QCamera::roll(float angle)
카메라 롤을 angle 만큼 (도 단위) 조정합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QCamera::rollAboutViewCenter(float angle)
뷰 중심을 기준으로 카메라 롤을 angle 만큼(도 단위) 조정합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] QQuaternion QCamera::rollRotation(float angle) const
angle 를 기준으로 계산된 롤 회전 각도를 도 단위로 반환하며, 이 값은 카메라의 Z축을 중심으로 한 좌/우 롤 또는 기울기 회전을 조정하는 데 사용됩니다.
참고: 이 함수는 메타 객체 시스템 및 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QCamera::rotate(const QQuaternion &q)
q 에서 쿼터니언을 사용하여 카메라를 회전합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QCamera::rotateAboutViewCenter(const QQuaternion &q)
q 에 정의된 쿼터니언을 사용하여 뷰 중심을 기준으로 카메라를 회전합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] QQuaternion QCamera::rotation(float angle, const QVector3D &axis) const
angle 를 기준으로 계산된 회전 각도를 도 단위로, 그리고 지정된 axis 의 방향에 따라 반환합니다.
참고: 이 함수는 메타 객체 시스템 및 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[slot] void QCamera::setAspectRatio(float aspectRatio)
카메라의 화면 비율을 aspectRatio 로 설정합니다.
참고: aspectRatio 속성에 대한설정 함수입니다.
aspectRatio()도 참조하십시오 .
[slot] void QCamera::setBottom(float bottom)
카메라의 하단 위치를 ` bottom`로 설정합니다.
참고: bottom 속성에 대한세터 함수입니다.
bottom()도 참조하십시오 .
[slot] void QCamera::setExposure(float exposure)
카메라의 노출을 ` exposure`로 설정합니다.
참고: exposure 속성의설정 함수입니다.
exposure()도 참조하십시오 .
[slot] void QCamera::setFarPlane(float farPlane)
카메라의 원거리 평면을 다음과 같이 설정합니다. farPlane
참고: 속성 ` farPlane`에 대한설정 함수입니다.
farPlane()도 참조하십시오 .
[slot] void QCamera::setFieldOfView(float fieldOfView)
카메라의 시야각을 fieldOfView (도 단위)로 설정합니다.
참고: fieldOfView 속성에 대한설정 함수입니다.
fieldOfView()도 참조하십시오 .
[slot] void QCamera::setLeft(float left)
카메라의 왼쪽을 ` left`로 설정합니다.
참고: left 속성에 대한세터 함수입니다.
left()도 참조하십시오 .
[slot] void QCamera::setNearPlane(float nearPlane)
카메라의 근평면을 nearPlane 로 설정합니다.
참고: nearPlane 속성에 대한설정 함수입니다.
nearPlane()도 참조하십시오 .
[slot] void QCamera::setPosition(const QVector3D &position)
3D 공간에서 카메라의 위치를 ` position`로 설정합니다.
참고: position 속성에 대한설정 함수입니다.
position()도 참조하십시오 .
[slot] void QCamera::setProjectionMatrix(const QMatrix4x4 &projectionMatrix)
카메라의 투영 행렬을 projectionMatrix 로 설정합니다.
참고: projectionMatrix 속성에 대한설정 함수입니다.
projectionMatrix()도 참조하십시오 .
[slot] void QCamera::setProjectionType(Qt3DRender::QCameraLens::ProjectionType type)
카메라의 투영 유형을 ‘ type ’로 설정합니다.
참고: projectionType 속성에 대한세터 함수입니다.
projectionType()도 참조하십시오 .
[slot] void QCamera::setRight(float right)
카메라의 오른쪽을 ` right`로 설정합니다.
참고: right 속성에 대한설정 함수입니다.
right()도 참조하십시오 .
[slot] void QCamera::setTop(float top)
카메라의 상단 위치를 top 로 설정합니다.
참고: top 속성에 대한세터 함수입니다.
top()도 참조하십시오 .
[slot] void QCamera::setUpVector(const QVector3D &upVector)
카메라의 상향 벡터를 ` upVector`로 설정합니다.
참고: upVector 속성에 대한세터 함수입니다.
upVector()도 참조하십시오 .
[slot] void QCamera::setViewCenter(const QVector3D &viewCenter)
카메라의 시야 중심을 ` viewCenter`로 설정합니다.
참고: viewCenter 속성에 대한설정 함수입니다.
viewCenter()도 참조하십시오 .
[invokable] void QCamera::tilt(float angle)
카메라의 기울기 각도를 angle 만큼(도 단위) 조정합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QCamera::tiltAboutViewCenter(float angle)
뷰 중심을 기준으로 카메라의 기울기를 angle 만큼(도 단위) 조정합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] QQuaternion QCamera::tiltRotation(float angle) const
angle 를 기준으로 계산된 틸트 회전 각도를 도(°) 단위로 반환하며, 이 값을 사용하여 카메라의 틸트 또는 X축을 중심으로 한 상하 회전을 조정합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
Qt3DCore::QTransform *QCamera::transform() const
트랜스폼을 통해 카메라의 위치를 반환합니다.
참고: transform 속성에 대한게터 함수입니다.
[invokable] void QCamera::translate(const QVector3D &vLocal, Qt3DRender::QCamera::CameraTranslationOption option = TranslateViewCenter)
카메라의 위치와 시야 벡터를 로컬 좌표계에서 vLocal 만큼 변환합니다. ` option `을 사용하면 시야 중심을 변환할지 여부를 설정할 수 있습니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QCamera::translateWorld(const QVector3D &vWorld, Qt3DRender::QCamera::CameraTranslationOption option = TranslateViewCenter)
카메라의 위치와 시야 벡터를 세계 좌표계에서 vWorld 만큼 변환합니다. ` option `를 사용하면 시야 중심을 변환할지 여부를 토글할 수 있습니다.
참고: 이 함수는 메타 객체 시스템 및 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[slot] void QCamera::viewAll()
카메라의 정점( viewCenter )이 씬의 바운딩 볼륨 중심이 되도록, 그리고 전체 씬이 뷰포트에 들어갈 수 있도록 카메라를 회전 및 이동합니다.
참고: 렌즈가 투시 투영 모드나 직교 투영 모드일 때만 작동합니다.
Qt3D.Render::Camera::projectionType항목도 참조하십시오 .
[slot] void QCamera::viewEntity(Qt3DCore::QEntity *entity)
카메라의 원점( viewCenter )이 엔티티( entity)의 경계 볼륨(bounding volume) 중심에 오고, 엔티티 전체가 뷰포트(view port)에 들어오도록 카메라를 회전 및 이동합니다.
참고: 렌즈가 투시 투영 또는 직교 투영 모드일 때만 작동합니다.
Camera.projectionType도 참조하십시오 .
[slot] void QCamera::viewSphere(const QVector3D ¢er, float radius)
카메라의 원점( viewCenter )이 center 에 오고, radius 크기의 구가 뷰포트에 들어갈 수 있도록 카메라를 회전하고 이동합니다.
참고: 렌즈가 투시 투영 또는 직교 투영 모드일 때만 작동합니다.
Qt3D.Render::Camera::projectionType도 참조하십시오 .
© 2026 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.