summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/loader-qml/SphereEntity.qml
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-07-21 10:12:29 +0200
committerPaul Lemire <paul.lemire@kdab.com>2015-07-25 10:07:38 +0000
commit9c95de596dfd6e1dc8630d4e020103646e1d0ae1 (patch)
treefd1cfbef1552029e1ab2fd0590b297a7da4303ef /examples/qt3d/loader-qml/SphereEntity.qml
parent37f9d95b848127706f417f91254fad3addcc40cd (diff)
loader-qml: Added materials and animations
Helps ensure that property updates and complex nodes such as Materials are properly created and updated dynamically Change-Id: I126f971d2c94bcc45e368e9b2a15d0d1e7d456d4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/loader-qml/SphereEntity.qml')
-rw-r--r--examples/qt3d/loader-qml/SphereEntity.qml33
1 files changed, 32 insertions, 1 deletions
diff --git a/examples/qt3d/loader-qml/SphereEntity.qml b/examples/qt3d/loader-qml/SphereEntity.qml
index 2825b8253..f69ce0613 100644
--- a/examples/qt3d/loader-qml/SphereEntity.qml
+++ b/examples/qt3d/loader-qml/SphereEntity.qml
@@ -36,12 +36,43 @@
import Qt3D 2.0
import Qt3D.Renderer 2.0
+import QtQuick 2.4 as QQ2
Entity {
- components: [ mesh, material ]
+ components: [ mesh, material, transform ]
SphereMesh {
id: mesh
radius: 3
}
+
+ Transform {
+ id: transform
+
+ Scale {
+ id: _scale
+ scale: 3
+ }
+ }
+
+ QQ2.ColorAnimation {
+ target: material
+ property: "diffuse"
+ from: "yellow"
+ to: "orange"
+ duration: 1500
+ loops: QQ2.Animation.Infinite
+ running: true
+ }
+
+ QQ2.NumberAnimation {
+ target: _scale
+ property: "scale"
+ duration: 1500
+ loops: QQ2.Animation.Infinite
+ running: true
+ easing.type: QQ2.Easing.InOutQuad
+ from: 1
+ to: 1.5
+ }
}