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/wireframe | |
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/wireframe')
-rw-r--r-- | examples/qt3d/wireframe/TrefoilKnot.qml | 27 | ||||
-rw-r--r-- | examples/qt3d/wireframe/main.qml | 2 |
2 files changed, 18 insertions, 11 deletions
diff --git a/examples/qt3d/wireframe/TrefoilKnot.qml b/examples/qt3d/wireframe/TrefoilKnot.qml index 8b05c8ab9..4d51e067b 100644 --- a/examples/qt3d/wireframe/TrefoilKnot.qml +++ b/examples/qt3d/wireframe/TrefoilKnot.qml @@ -40,22 +40,29 @@ import Qt3D.Render 2.0 Entity { id: root - property alias x: translation.dx - property alias y: translation.dy - property alias z: translation.dz - property alias scale: scaleTransform.scale - property alias theta: thetaRotation.angle - property alias phi: phiRotation.angle + property real x: 0.0 + property real y: 0.0 + property real z: 0.0 + property real scale: 1.0 + property real theta: 0.0 + property real phi: 0.0 property Material material components: [ transform, mesh, root.material ] Transform { id: transform - Translate { id: translation } - Scale { id: scaleTransform } - Rotate{ id: thetaRotation; axis: Qt.vector3d( 1.0, 0.0, 0.0 ) } - Rotate{ id: phiRotation; 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; + } } Mesh { diff --git a/examples/qt3d/wireframe/main.qml b/examples/qt3d/wireframe/main.qml index 8e06a8b19..ed3f2899f 100644 --- a/examples/qt3d/wireframe/main.qml +++ b/examples/qt3d/wireframe/main.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 |