Debian Codegraph @

tests/manual/advancedcustommaterial/main.qml

raw
1 // Copyright (C) 2017 The Qt Company Ltd.
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 import QtQuick 2.0
5 import QtQuick.Scene3D 2.0
6 import Qt3D.Render 2.0
7 import QtQuick.Controls 2.0
8
9
10 Item {
11
12 Rectangle {
13 id: scene
14 property bool colorChange: true
15 anchors.fill: parent
16 color: "#2d2d2d"
17
18 transform: Rotation {
19 id: sceneRotation
20 axis.x: 1
21 axis.y: 0
22 axis.z: 0
23 origin.x: scene.width / 2
24 origin.y: scene.height / 2
25 }
26 Rectangle {
27 id: controlsbg
28 anchors.fill: parent
29 anchors.leftMargin: 10
30 anchors.topMargin: 10
31 anchors.rightMargin: 1720
32 anchors.bottomMargin: 10
33 color: "grey"
34 Column {
35 anchors.fill: parent
36 anchors.leftMargin: 5
37 anchors.topMargin: 5
38 spacing: 10
39 Rectangle {
40 id: slidertexscale
41 width: 180
42 height: 60
43 color: "#2d2d2d"
44 Text {
45 id: scaletext
46 anchors.horizontalCenter: parent.horizontalCenter
47 anchors.top: parent.top
48 anchors.topMargin: 10
49 text: "TEXTURE SCALE"
50 color: "white"
51 font.bold: true
52 font.pointSize: 12
53 }
54 Slider {
55 id: slider1
56 anchors.fill: parent
57 anchors.topMargin: 30
58 anchors.rightMargin: 10
59 anchors.leftMargin: 10
60 value: 1.0
61 from: 0.3
62 }
63 }
64 Rectangle {
65 id: slidertexturespeed
66 width: 180
67 height: 60
68 color: "#2d2d2d"
69 Text {
70 id: texturespeedtext
71 anchors.horizontalCenter: parent.horizontalCenter
72 anchors.top: parent.top
73 anchors.topMargin: 10
74 text: "TEXTURE SPEED"
75 color: "white"
76 font.bold: true
77 font.pointSize: 12
78 }
79 Slider {
80 id: slider5
81 anchors.fill: parent
82 anchors.topMargin: 30
83 anchors.rightMargin: 10
84 anchors.leftMargin: 10
85 value: 1.1
86 to: 4.0
87 from: 0.0
88 }
89 }
90 Rectangle {
91 id: sliderspecularity
92 width: 180
93 height: 60
94 color: "#2d2d2d"
95 Text {
96 id: specularitytext
97 anchors.horizontalCenter: parent.horizontalCenter
98 anchors.top: parent.top
99 anchors.topMargin: 10
100 text: "SPECULARITY"
101 color: "white"
102 font.bold: true
103 font.pointSize: 12
104 }
105 Slider {
106 id: slider3
107 anchors.fill: parent
108 anchors.topMargin: 30
109 anchors.rightMargin: 10
110 anchors.leftMargin: 10
111 value: 1.0
112 to: 3.0
113 from: 0.0
114 }
115 }
116 Rectangle {
117 id: sliderdistortion
118 width: 180
119 height: 60
120 color: "#2d2d2d"
121 Text {
122 id: distortiontext
123 anchors.horizontalCenter: parent.horizontalCenter
124 anchors.top: parent.top
125 anchors.topMargin: 10
126 text: "DISTORTION"
127 color: "white"
128 font.bold: true
129 font.pointSize: 12
130 }
131 Slider {
132 id: slider7
133 anchors.fill: parent
134 anchors.topMargin: 30
135 anchors.rightMargin: 10
136 anchors.leftMargin: 10
137 value: 0.015
138 to: 0.1
139 from: 0.0
140 }
141 }
142 Rectangle {
143 id: slidernormal
144 width: 180
145 height: 60
146 color: "#2d2d2d"
147 Text {
148 id: normaltext
149 anchors.horizontalCenter: parent.horizontalCenter
150 anchors.top: parent.top
151 anchors.topMargin: 10
152 text: "NORMAL AMOUNT"
153 color: "white"
154 font.bold: true
155 font.pointSize: 12
156 }
157 Slider {
158 id: slider8
159 anchors.fill: parent
160 anchors.topMargin: 30
161 anchors.rightMargin: 10
162 anchors.leftMargin: 10
163 value: 2.2
164 to: 4.0
165 from: 0.0
166 }
167 }
168 Rectangle {
169 id: sliderwavespeed
170 width: 180
171 height: 60
172 color: "#2d2d2d"
173 Text {
174 id: wawespeedtext
175 anchors.horizontalCenter: parent.horizontalCenter
176 anchors.top: parent.top
177 anchors.topMargin: 10
178 text: "WAVE SPEED"
179 color: "white"
180 font.bold: true
181 font.pointSize: 12
182 }
183 Slider {
184 id: slider2
185 live: false
186 anchors.fill: parent
187 anchors.topMargin: 30
188 anchors.rightMargin: 10
189 anchors.leftMargin: 10
190 value: 0.75
191 to: 4.0
192 from: 0.1
193 }
194 }
195 Rectangle {
196 id: sliderwaveheight
197 width: 180
198 height: 60
199 color: "#2d2d2d"
200 Text {
201 id: waweheighttext
202 anchors.horizontalCenter: parent.horizontalCenter
203 anchors.top: parent.top
204 anchors.topMargin: 10
205 text: "WAVE HEIGHT"
206 color: "white"
207 font.bold: true
208 font.pointSize: 12
209 }
210 Slider {
211 id: slider6
212 anchors.fill: parent
213 anchors.topMargin: 30
214 anchors.rightMargin: 10
215 anchors.leftMargin: 10
216 value: 0.2
217 to: 0.5
218 from: 0.02
219 }
220 }
221 Rectangle {
222 id: slidermeshrotation
223 width: 180
224 height: 60
225 color: "#2d2d2d"
226 Text {
227 id: meshrotationtext
228 anchors.horizontalCenter: parent.horizontalCenter
229 anchors.top: parent.top
230 anchors.topMargin: 10
231 text: "MESH ROTATION"
232 color: "white"
233 font.bold: true
234 font.pointSize: 12
235 }
236 Slider {
237 id: slider4
238 anchors.fill: parent
239 anchors.topMargin: 30
240 anchors.rightMargin: 10
241 anchors.leftMargin: 10
242 value: 35.0
243 to: 360.0
244 from: 0.0
245 }
246 }
247 }
248 }
249
250 Scene3D {
251 id: scene3d
252 anchors.fill: parent
253 anchors.leftMargin: 200
254 anchors.topMargin: 10
255 anchors.rightMargin: 10
256 anchors.bottomMargin: 10
257 focus: true
258 aspects: ["input", "logic"]
259 cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
260
261 SceneRoot {
262 id: root
263 }
264 }
265 }
266 }