Qt 3D: 간단한 QML 예제
Qt 3D 에서 씬을 렌더링하는 방법을 보여주는 QML 애플리케이션입니다.

이간단한 예제는 Qt 3D 에서 장면을 렌더링하는 방법을 보여줍니다.
예제 실행
다음 경로에서 예제를 실행할 수 있습니다:
- Qt Creator
Welcome 모드를 열고 Examples 에서 예제를 선택하십시오. 자세한 내용은 Qt Creator: 튜토리얼: 빌드 및 실행을 참조하십시오.
- Qt Extension for Visual Studio Code
Command Palette 에서 Qt: Open Qt examples 명령을 실행하고 목록에서 예제를 선택합니다. 자세한 내용은 Qt Extension for Visual Studio Code: 튜토리얼: 빌드 및 실행을 참조하십시오.
씬 설정
전체 씬은 main.qml 파일에서 설정합니다.
Q3D 및 Q3D Render 모듈의 타입을 사용하려면 해당 모듈을 임포트해야 합니다:
import Qt3D.Core 2.0
import Qt3D.Render 2.0가장 먼저 생성할 엔티티는 최종 렌더링에 사용되는 카메라를 나타내는 ` Camera`와, 키보드나 마우스를 사용하여 이 카메라를 제어할 수 있게 해주는 카메라 컨트롤러입니다:
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 45
aspectRatio: 16/9
nearPlane : 0.1
farPlane : 1000.0
position: Qt.vector3d( 0.0, 0.0, -40.0 )
upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
}RenderSettings 엔티티는 ForwardRenderer를 활성 프레임그래프로 지정합니다:
components: [
RenderSettings {
activeFrameGraph: ForwardRenderer {
clearColor: Qt.rgba(0, 0.5, 1, 1)
camera: camera
showDebugOverlay: true
}
},
// Event Source will be set by the Qt3DQuickWindow
InputSettings { }
]이벤트 소스는 Qt3DQuickWindow에 의해 설정됩니다:
InputSettings { }© 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.