Debian Codegraph @

tests/manual/phong-cubes/main.qml

raw
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.10
8 import QtQuick 2.0
9
10 Entity {
11 components: [
12 RenderSettings {
13 activeFrameGraph: ForwardRenderer {
14 clearColor: "white"
15 camera: mainCamera
16 }
17 },
18 InputSettings { }
19 ]
20
21 Camera {
22 id: mainCamera
23 position: Qt.vector3d(0.0, 0.0, 7.0)
24 upVector: Qt.vector3d(0.0, 1.0, 0.0)
25 viewCenter: Qt.vector3d(0.0, 0.0, 0.0)
26 }
27
28 FirstPersonCameraController {
29 camera: mainCamera
30 }
31
32 Entity {
33 components: [
34 PointLight {},
35 Transform { translation: mainCamera.position }
36 ]
37 }
38
39 CubeEntity {
40 position: Qt.vector3d(-1, 1, 0)
41 material: DiffuseSpecularMaterial {}
42 }
43
44 CubeEntity {
45 position: Qt.vector3d(0, 1, 0)
46 material: DiffuseSpecularMaterial {
47 diffuse: TextureLoader { source: "qrc:/assets/textures/aluminium_random_brushed/aluminium_random_brushed_basecolor.png" }
48 }
49 }
50
51 CubeEntity {
52 position: Qt.vector3d(1, 1, 0)
53 material: DiffuseSpecularMaterial {
54 diffuse: TextureLoader { source: "qrc:/assets/textures/aluminium_random_brushed/aluminium_random_brushed_basecolor.png" }
55 specular: TextureLoader { source: "qrc:/assets/textures/aluminium_random_brushed/aluminium_random_brushed_metallic.png" }
56 }
57 }
58
59 CubeEntity {
60 position: Qt.vector3d(-1, 0, 0)
61 material: DiffuseSpecularMaterial {
62 alphaBlending: true
63 diffuse: Qt.rgba(0.7, 0.7, 0.7, 0.5)
64 }
65 }
66
67 CubeEntity {
68 position: Qt.vector3d(0, 0, 0)
69 material: DiffuseSpecularMaterial {
70 normal: TextureLoader { source: "qrc:/assets/textures/aluminium_random_brushed/aluminium_random_brushed_basecolor.png" }
71 diffuse: TextureLoader { source: "qrc:/assets/textures/aluminium_random_brushed/aluminium_random_brushed_metallic.png" }
72 }
73 }
74
75 CubeEntity {
76 position: Qt.vector3d(1, 0, 0)
77 material: DiffuseSpecularMaterial {
78 alphaBlending: true
79 normal: TextureLoader { source: "qrc:/assets/textures/aluminium_random_brushed/aluminium_random_brushed_basecolor.png" }
80 diffuse: TextureLoader { source: "qrc:/assets/textures/aluminium_random_brushed/aluminium_random_brushed_metallic.png" }
81 }
82 }
83
84 CubeEntity {
85 position: Qt.vector3d(-1, -1, 0)
86 material: DiffuseSpecularMaterial {
87 normal: TextureLoader { source: "qrc:/assets/textures/copper_brushed/copper_brushed_normal.png" }
88 diffuse: TextureLoader { source: "qrc:/assets/textures/copper_brushed/copper_brushed_basecolor.png" }
89 specular: TextureLoader { source: "qrc:/assets/textures/copper_brushed/copper_brushed_metallic.png" }
90 }
91 }
92
93 CubeEntity {
94 position: Qt.vector3d(0, -1, 0)
95 material: DiffuseSpecularMaterial {
96 normal: TextureLoader { source: "qrc:/assets/textures/copper_brushed/copper_brushed_normal.png" }
97 diffuse: TextureLoader { source: "qrc:/assets/textures/copper_brushed/copper_brushed_basecolor.png" }
98 specular: TextureLoader { source: "qrc:/assets/textures/copper_brushed/copper_brushed_metallic.png" }
99 }
100 }
101
102 CubeEntity {
103 position: Qt.vector3d(1, -1, 0)
104 material: DiffuseSpecularMaterial {
105 normal: TextureLoader { source: "qrc:/assets/textures/copper_brushed/copper_brushed_normal.png" }
106 diffuse: TextureLoader { source: "qrc:/assets/textures/copper_brushed/copper_brushed_basecolor.png" }
107 specular: TextureLoader { source: "qrc:/assets/textures/copper_brushed/copper_brushed_metallic.png" }
108 }
109 }
110 }