summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/enabled-qml
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2015-11-07 19:02:14 +0000
committerPaul Lemire <paul.lemire@kdab.com>2015-11-17 19:41:18 +0000
commit26a118cfbce29014864f6cdddae66cccb65ffb4f (patch)
treedaea9f2fc41c1df586c35cd56daa61f920ce5b58 /examples/qt3d/enabled-qml
parentace675a084ab944a245500b9f54be653126c3147 (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/enabled-qml')
-rw-r--r--examples/qt3d/enabled-qml/main.qml43
1 files changed, 16 insertions, 27 deletions
diff --git a/examples/qt3d/enabled-qml/main.qml b/examples/qt3d/enabled-qml/main.qml
index 379c00d36..438491936 100644
--- a/examples/qt3d/enabled-qml/main.qml
+++ b/examples/qt3d/enabled-qml/main.qml
@@ -54,7 +54,7 @@ Entity {
}
CameraSelector {
- camera: basicCamera
+ camera: camera
enabled: counter !== 7
LayerFilter {
@@ -76,28 +76,17 @@ Entity {
}
}
- Entity {
- id: basicCamera
-
- Transform {
- id: basicCameraTransform
- LookAt {
- upVector: Qt.vector3d(0, 1, 0)
- viewCenter: Qt.vector3d(0, 0, 0)
- position: Qt.vector3d(0, 10, -10)
- }
- }
- components: [basicCameraTransform, cameraLens]
- }
-
- CameraLens {
- id: cameraLens
+ Camera {
+ id: camera
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 45
aspectRatio: 16/9
nearPlane : 0.1
farPlane : 1000.0
enabled: counter !== 4
+ position: Qt.vector3d(0, 10, -10)
+ viewCenter: Qt.vector3d(0, 0, 0)
+ upVector: Qt.vector3d(0, 1, 0)
}
// Sphere
@@ -123,48 +112,48 @@ Entity {
Transform {
id: transform
+ property real x: 0.0
+ property real y: 0.0
+ property real z: 0.0
+ translation: Qt.vector3d(x, y, z)
enabled: counter !== 3
-
- Translate {
- id: translate
- }
}
QQ2.SequentialAnimation {
running: true
loops: QQ2.Animation.Infinite
QQ2.NumberAnimation {
- target: translate; property: "dx"
+ target: transform; property: "x"
from: 0; to: 5;
duration: 550
easing.type: QQ2.Easing.InOutQuad
}
QQ2.NumberAnimation {
- target: translate; property: "dy"
+ target: transform; property: "y"
from: 0; to: 5;
duration: 650
easing.type: QQ2.Easing.InOutQuad
}
QQ2.NumberAnimation {
- target: translate; property: "dz"
+ target: transform; property: "z"
from: 0; to: 5;
duration: 350
easing.type: QQ2.Easing.InOutQuad
}
QQ2.NumberAnimation {
- target: translate; property: "dx"
+ target: transform; property: "x"
from: 5; to: 0;
duration: 550
easing.type: QQ2.Easing.InOutQuad
}
QQ2.NumberAnimation {
- target: translate; property: "dy"
+ target: transform; property: "y"
from: 5; to: 0;
duration: 350
easing.type: QQ2.Easing.InOutQuad
}
QQ2.NumberAnimation {
- target: translate; property: "dz"
+ target: transform; property: "z"
from: 5; to: 0;
duration: 650
easing.type: QQ2.Easing.InOutQuad