| 1 |
// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
import Qt3D.Core 2.0 |
| 5 |
import Qt3D.Render 2.0 |
| 6 |
import Qt3D.Input 2.0 |
| 7 |
import Qt3D.Extras 2.0 |
| 8 |
|
| 9 |
Entity { |
| 10 |
id: sceneRoot |
| 11 |
|
| 12 |
Camera { |
| 13 |
id: camera |
| 14 |
position: Qt.vector3d( 0.0, 0.5, 15.0 ) |
| 15 |
viewCenter: Qt.vector3d( 0.0, 0.5, 0.0 ) |
| 16 |
} |
| 17 |
|
| 18 |
OrbitCameraController { camera: camera } |
| 19 |
|
| 20 |
RenderSettings { |
| 21 |
id : external_forward_renderer |
| 22 |
activeFrameGraph : ForwardRenderer { |
| 23 |
camera: camera |
| 24 |
clearColor: "white" |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
// Event Source will be set by the Qt3DQuickWindow |
| 29 |
InputSettings { id: inputSettings } |
| 30 |
|
| 31 |
DirectionalLight { id: light; worldDirection: camera.viewVector } |
| 32 |
|
| 33 |
components: [external_forward_renderer, inputSettings, light] |
| 34 |
|
| 35 |
Mesh { |
| 36 |
id: mesh |
| 37 |
source: "https://codereview.qt-project.org/gitweb?p=qt/qt3d.git;a=blob_plain;f=examples/qt3d/exampleresources/assets/obj/plane-10x10.obj" |
| 38 |
onStatusChanged: console.log("Mesh status " + status) |
| 39 |
} |
| 40 |
|
| 41 |
Transform { |
| 42 |
id: transform |
| 43 |
scale: 0.03 |
| 44 |
rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 30) |
| 45 |
} |
| 46 |
|
| 47 |
DiffuseMapMaterial { |
| 48 |
id: material |
| 49 |
diffuse: TextureLoader { |
| 50 |
source: "https://codereview.qt-project.org/gitweb?p=qt/qt3d.git;a=blob_plain;hb=refs/heads/dev;f=examples/qt3d/planets-qml/images/solarsystemscope/earthmap2k.jpg" |
| 51 |
onStatusChanged: console.log("TextureLoader status " + status) |
| 52 |
} |
| 53 |
specular: Qt.rgba( 0.2, 0.2, 0.2, 1.0 ) |
| 54 |
shininess: 2.0 |
| 55 |
} |
| 56 |
|
| 57 |
Entity { |
| 58 |
id: mainEntity |
| 59 |
objectName: "mainEntity" |
| 60 |
components: [ mesh, material, transform ] |
| 61 |
} |
| 62 |
} |