diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2015-11-07 19:02:14 +0000 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2015-11-17 19:41:18 +0000 |
commit | 26a118cfbce29014864f6cdddae66cccb65ffb4f (patch) | |
tree | daea9f2fc41c1df586c35cd56daa61f920ce5b58 /examples/qt3d/wave | |
parent | ace675a084ab944a245500b9f54be653126c3147 (diff) |
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 <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/wave')
-rw-r--r-- | examples/qt3d/wave/Background.qml | 12 | ||||
-rw-r--r-- | examples/qt3d/wave/Wave.qml | 15 | ||||
-rw-r--r-- | examples/qt3d/wave/main.qml | 1 |
3 files changed, 20 insertions, 8 deletions
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 |