diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2015-11-11 16:35:30 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2015-11-20 18:28:13 +0000 |
commit | 8f6462aa1f0f29c8f39d25214c4ccf802824f2d5 (patch) | |
tree | 87810d10c3882480a402be1130a29a66e87a6e06 /examples/qt3d/anaglyph-rendering | |
parent | a081396ccea6903ee9bd9c07a3c0694f92f91e1f (diff) |
Adapt examples to use new quaternion helpers
Change-Id: If9100fbc1870c09d90c9c1df102cf9c0503b96cb
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/anaglyph-rendering')
-rw-r--r-- | examples/qt3d/anaglyph-rendering/main.qml | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/examples/qt3d/anaglyph-rendering/main.qml b/examples/qt3d/anaglyph-rendering/main.qml index 54902d777..cb852a675 100644 --- a/examples/qt3d/anaglyph-rendering/main.qml +++ b/examples/qt3d/anaglyph-rendering/main.qml @@ -88,15 +88,7 @@ Entity { id: cylinderTransform property real theta: 0.0 property real phi: 0.0 - property real userScale: 1.0 - - matrix: { - var m = Qt.matrix4x4(); - m.rotate(phi, Qt.vector3d(0.0, 1.0, 0.0)); - m.rotate(theta, Qt.vector3d(1.0, 0.0, 0.0)); - m.scale(userScale); - return m; - } + rotation: fromEulerAngles(theta, phi, 0) } property Material phong: PhongMaterial {} @@ -106,14 +98,14 @@ Entity { QQ2.SequentialAnimation { QQ2.NumberAnimation { target: cylinderTransform - property: "userScale" + property: "scale" from: 5; to: 45 duration: 2000 easing.type: QQ2.Easing.OutInQuad } QQ2.NumberAnimation { target: cylinderTransform - property: "userScale" + property: "scale" from: 45; to: 5 duration: 2000 easing.type: QQ2.Easing.InOutQuart @@ -145,16 +137,11 @@ Entity { Transform { id: planeTransform property real rollAngle: 0.0 - - matrix: { - var m = Qt.matrix4x4(); - m.translate(Qt.vector3d(Math.sin(stereoCamera.circleRotation * -2) * obstaclesRepeater.radius, - 0.0, - Math.cos(stereoCamera.circleRotation * -2) * obstaclesRepeater.radius)) - m.rotate(stereoCamera.circleRotation * -2 * 180 / Math.PI + 180, Qt.vector3d(0.0, 1.0, 0.0)); - m.rotate(planeTransform.rollAngle, Qt.vector3d(1.0, 0.0, 0.0)); - return m; - } + translation: Qt.vector3d(Math.sin(stereoCamera.circleRotation * -2) * obstaclesRepeater.radius, + 0.0, + Math.cos(stereoCamera.circleRotation * -2) * obstaclesRepeater.radius) + rotation: fromAxesAndAngles(Qt.vector3d(1.0, 0.0, 0.0), planeTransform.rollAngle, + Qt.vector3d(0.0, 1.0, 0.0), stereoCamera.circleRotation * -2 * 180 / Math.PI + 180) }, PhongMaterial { shininess: 20.0 |