From 26a118cfbce29014864f6cdddae66cccb65ffb4f Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Sat, 7 Nov 2015 19:02:14 +0000 Subject: Remove transforms property of QTransform Compound transformations are now built up using QMatrix4x4 in both QML and C++. Updating examples accordingly. Change-Id: I03c9abf1f6cdd1b56226dc0e16a7ad5ce84516dd Reviewed-by: Paul Lemire --- examples/qt3d/wave/Background.qml | 12 ++++++++---- examples/qt3d/wave/Wave.qml | 15 +++++++++++---- examples/qt3d/wave/main.qml | 1 + 3 files changed, 20 insertions(+), 8 deletions(-) (limited to 'examples/qt3d/wave') diff --git a/examples/qt3d/wave/Background.qml b/examples/qt3d/wave/Background.qml index 64468209b..7c6ed4952 100644 --- a/examples/qt3d/wave/Background.qml +++ b/examples/qt3d/wave/Background.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ +import QtQuick 2.1 as QQ2 import Qt3D.Core 2.0 import Qt3D.Render 2.0 -import QtQuick 2.1 as QQ2 Entity { id: root @@ -72,9 +72,13 @@ Entity { Transform { // Rotate the plane so that it faces us - Rotate { - axis: Qt.vector3d( 1.0, 0.0, 0.0 ) - angle: 90 + matrix: { + var m = Qt.matrix4x4(1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1); + m.rotate(90, Qt.vector3d(1, 0, 0)); + return m; } }, diff --git a/examples/qt3d/wave/Wave.qml b/examples/qt3d/wave/Wave.qml index 708e35775..9bbb707a9 100644 --- a/examples/qt3d/wave/Wave.qml +++ b/examples/qt3d/wave/Wave.qml @@ -59,10 +59,17 @@ Entity { Transform { id: transform - Translate { dx: root.x; dy: root.y; dz: root.z } - Scale { scale: root.scale } - Rotate{ angle: root.theta; axis: Qt.vector3d(1.0, 0.0, 0.0) } - Rotate{ angle: root.phi; axis: Qt.vector3d(0.0, 1.0, 0.0) } + matrix: { + var m = Qt.matrix4x4(1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1); + m.translate(Qt.vector3d(root.x, root.y, root.z)); + m.rotate(root.phi, Qt.vector3d(0, 1, 0)); + m.rotate(root.theta, Qt.vector3d(1, 0, 0)); + m.scale(root.scale); + return m; + } } WaveMaterial { diff --git a/examples/qt3d/wave/main.qml b/examples/qt3d/wave/main.qml index a81a6c38a..6f7aaddb9 100644 --- a/examples/qt3d/wave/main.qml +++ b/examples/qt3d/wave/main.qml @@ -34,6 +34,7 @@ ** ****************************************************************************/ +import QtQuick 2.1 as QQ2 import Qt3D.Core 2.0 import Qt3D.Render 2.0 import Qt3D.Input 2.0 -- cgit v1.2.3