diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2015-11-11 12:18:26 +0000 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2015-11-20 16:34:26 +0000 |
commit | cf52d92133a356784e0f784e810b232290d8d3da (patch) | |
tree | f89d68477f59d8a38970402119ccfe8b2b8082e5 /examples/qt3d/scene3d/AnimatedEntity.qml | |
parent | ba3e89e4b609d19b0607d2cb1cdf13b83f6cd984 (diff) |
Adapt examples to use rotation property and quaternion helper
This covers all examples that can use the standard S, R, T order of
transformations with a single rotation.
Change-Id: Ief6741f9605742c545d8ef2be9bf8ab65164835d
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/scene3d/AnimatedEntity.qml')
-rw-r--r-- | examples/qt3d/scene3d/AnimatedEntity.qml | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/examples/qt3d/scene3d/AnimatedEntity.qml b/examples/qt3d/scene3d/AnimatedEntity.qml index 5431db8ea..68871f04b 100644 --- a/examples/qt3d/scene3d/AnimatedEntity.qml +++ b/examples/qt3d/scene3d/AnimatedEntity.qml @@ -92,15 +92,8 @@ Entity { Transform { id: torusTransform - matrix: { - var m = Qt.matrix4x4(1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1); - m.rotate(45, Qt.vector3d(1, 0, 0)) - m.scale(Qt.vector3d(1.5, 1, 0.5)); - return m; - } + scale3D: Qt.vector3d(1.5, 1, 0.5) + rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45) } Entity { @@ -117,12 +110,9 @@ Entity { id: sphereTransform property real userAngle: 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(20, 0, 0)); + var m = Qt.matrix4x4(); m.rotate(userAngle, Qt.vector3d(0, 1, 0)) + m.translate(Qt.vector3d(20, 0, 0)); return m; } } |