summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/bigmodel-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/bigmodel-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/bigmodel-qml')
-rw-r--r--examples/qt3d/bigmodel-qml/MyEntity.qml6
-rw-r--r--examples/qt3d/bigmodel-qml/main.qml5
2 files changed, 5 insertions, 6 deletions
diff --git a/examples/qt3d/bigmodel-qml/MyEntity.qml b/examples/qt3d/bigmodel-qml/MyEntity.qml
index 3e30b2fd3..df0dbd13d 100644
--- a/examples/qt3d/bigmodel-qml/MyEntity.qml
+++ b/examples/qt3d/bigmodel-qml/MyEntity.qml
@@ -39,13 +39,11 @@ 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 position: transform.translation
property alias diffuse: material.diffuse
components: [
- Transform { Translate { id: translation } },
+ Transform { id: transform },
SphereMesh { radius: 2 },
PhongMaterial { id: material }
]
diff --git a/examples/qt3d/bigmodel-qml/main.qml b/examples/qt3d/bigmodel-qml/main.qml
index efb82375a..56081055e 100644
--- a/examples/qt3d/bigmodel-qml/main.qml
+++ b/examples/qt3d/bigmodel-qml/main.qml
@@ -76,8 +76,9 @@ Entity {
id: myEntity
property real _lightness: 0.2 + 0.7 / collection._rows * Math.floor(index / collection.cols)
property real _hue: (index % collection.cols) / collection.cols
- x: collection.spacing * (index % collection.cols - 0.5 * (collection.cols - 1))
- z: collection.spacing * (Math.floor(index / collection.cols) - 0.5 * collection._rows)
+ position: Qt.vector3d(collection.spacing * (index % collection.cols - 0.5 * (collection.cols - 1)),
+ 0.0,
+ collection.spacing * (Math.floor(index / collection.cols) - 0.5 * collection._rows));
diffuse: Qt.hsla( _hue, 0.5, _lightness, 1.0 )
}
}