diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-11-30 14:03:46 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-11-30 13:46:41 +0000 |
commit | 07fcd52d9588eaa14e46cef743fd4c8e14599139 (patch) | |
tree | 4d46ba8ff0ee25bec724004d7e089531d395edea /examples/qt3d/lights | |
parent | 59420260b81116b3a726296f69c014c87a0631ef (diff) |
Enhance lights example
Two animated lights with the position of the lights represented
as spheres.
Change-Id: I5e337a4c2932e75dc4d676d4d9b9349249f6b227
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d/lights')
-rw-r--r-- | examples/qt3d/lights/main.qml | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/examples/qt3d/lights/main.qml b/examples/qt3d/lights/main.qml index eb28fc1a5..7423eeea0 100644 --- a/examples/qt3d/lights/main.qml +++ b/examples/qt3d/lights/main.qml @@ -65,7 +65,17 @@ Entity Entity { components: [ - Transform { translation: Qt.vector3d(2.0, 1.0, 1.0); }, + SphereMesh { + radius: 2 + }, + Transform { + translation: Qt.vector3d(2.0, 8.0, -2.0) + Quick.SequentialAnimation on translation.y { + loops: Quick.Animation.Infinite + Quick.NumberAnimation { from: 8.0; to: 40.0; duration: 3000 } + Quick.NumberAnimation { from: 40.0; to: 8.0; duration: 3000 } + } + }, PointLight { color: Qt.rgba(1, 0, 0, 1) } @@ -74,9 +84,19 @@ Entity Entity { components: [ - Transform { translation: Qt.vector3d(2.0, 3.0, 4.0); }, + SphereMesh { + radius: 2 + }, + Transform { + translation: Qt.vector3d(0.0, 3.0, 4.0) + Quick.SequentialAnimation on translation.z { + loops: Quick.Animation.Infinite + Quick.NumberAnimation { from: 4.0; to: 40.0; duration: 5000 } + Quick.NumberAnimation { from: 40.0; to: 4.0; duration: 5000 } + } + }, PointLight { - color: Qt.rgba(1, 0, 0, 1) + color: Qt.rgba(0, 1, 0, 1) } ] } |