From 07fcd52d9588eaa14e46cef743fd4c8e14599139 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 30 Nov 2015 14:03:46 +0100 Subject: Enhance lights example Two animated lights with the position of the lights represented as spheres. Change-Id: I5e337a4c2932e75dc4d676d4d9b9349249f6b227 Reviewed-by: Sean Harmer --- examples/qt3d/lights/main.qml | 26 +++++++++++++++++++++++--- 1 file 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) } ] } -- cgit v1.2.3