blob: c9e15d47d725f58f4b51e49445b2f5c72c8d2daf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick
import QtQuick3D
Window {
id: window
width: 1280
height: 720
visible: true
color: "#848895"
MaterialControl {
id: control
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
}
View3D {
anchors.fill: parent
camera: camera
PerspectiveCamera {
id: camera
position: Qt.vector3d(0, 200, 300)
eulerRotation.x: -30
}
//! [use]
Model {
position: Qt.vector3d(0, 0, 0)
NumberAnimation on eulerRotation.y {
from: 0
to: 360
duration: 3000
loops: -1
running: control.animateRotation
}
scale: Qt.vector3d(2, 2, 2)
source: "#Sphere"
materials: [
ExampleMaterial {
id: exampleMaterial
time: control.time
amplitude: control.amplitude
alpha: control.alpha
texturing: control.texturing
textureFromItem: control.textureFromItem
texSrc: Rectangle {
layer.enabled: true
layer.textureMirroring: ShaderEffectSource.NoMirroring
visible: false
SequentialAnimation on color {
ColorAnimation { from: "black"; to: "yellow"; duration: 2000 }
ColorAnimation { from: "yellow"; to: "cyan"; duration: 1000 }
ColorAnimation { from: "cyan"; to: "black"; duration: 500 }
loops: -1
}
width: 512
height: 512
Image {
source: "qt_logo.png"
anchors.centerIn: parent
}
}
}
]
}
//! [use]
}
}
|