| 1 |
// Copyright (C) 2014 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.Extras 2.0 |
| 7 |
|
| 8 |
Entity { |
| 9 |
id: sceneRoot |
| 10 |
|
| 11 |
components: [ |
| 12 |
RenderSettings { |
| 13 |
activeFrameGraph: ForwardRenderer { |
| 14 |
clearColor: Qt.rgba(0, 0.5, 1, 1) |
| 15 |
camera: camera |
| 16 |
} |
| 17 |
} |
| 18 |
] |
| 19 |
|
| 20 |
TemporaryCamera { |
| 21 |
id: camera |
| 22 |
pos: Qt.vector3d( 0.0, 0.0, 120.0 ) |
| 23 |
viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) |
| 24 |
up: Qt.vector3d( 0.0, 1.0, 0.0 ) |
| 25 |
} |
| 26 |
|
| 27 |
RenderableEntity { |
| 28 |
id: rootEntity |
| 29 |
|
| 30 |
meshSource: "assets/obj/toyplane.obj" |
| 31 |
material: PhongMaterial { |
| 32 |
diffuse: "red" |
| 33 |
} |
| 34 |
|
| 35 |
RenderableEntity { |
| 36 |
id: trefoil |
| 37 |
|
| 38 |
translation: Qt.vector3d( 0.0, 20.0, 0.0 ) |
| 39 |
scale: 4 |
| 40 |
|
| 41 |
meshSource: "assets/obj/trefoil.obj" |
| 42 |
material: PhongMaterial { |
| 43 |
diffuse: "green" |
| 44 |
} |
| 45 |
|
| 46 |
RenderableEntity { |
| 47 |
id: ball |
| 48 |
|
| 49 |
translation: Qt.vector3d( 0.0, 5.0, 0.0 ) |
| 50 |
scale: 0.2 |
| 51 |
|
| 52 |
meshSource: "assets/obj/ball.obj" |
| 53 |
material: PhongMaterial { |
| 54 |
diffuse: "purple" |
| 55 |
} |
| 56 |
} |
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
TrefoilKnot { |
| 61 |
translation: Qt.vector3d( 20, 0, 0 ) |
| 62 |
scale: 6.0 |
| 63 |
phi: 60.0 |
| 64 |
material: PhongMaterial { |
| 65 |
diffuse: "grey" |
| 66 |
} |
| 67 |
} |
| 68 |
} |