summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/clip-planes-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/clip-planes-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/clip-planes-qml')
-rw-r--r--examples/qt3d/clip-planes-qml/ClipPlaneEntity.qml16
-rw-r--r--examples/qt3d/clip-planes-qml/ClippingPlanes.qml2
-rw-r--r--examples/qt3d/clip-planes-qml/main.qml5
3 files changed, 15 insertions, 8 deletions
diff --git a/examples/qt3d/clip-planes-qml/ClipPlaneEntity.qml b/examples/qt3d/clip-planes-qml/ClipPlaneEntity.qml
index fdd3f803e..cccab558c 100644
--- a/examples/qt3d/clip-planes-qml/ClipPlaneEntity.qml
+++ b/examples/qt3d/clip-planes-qml/ClipPlaneEntity.qml
@@ -40,9 +40,8 @@ import Qt3D.Render 2.0
Entity {
id: root
property Material visualMaterial;
- property alias rotateAngle: _rotate.angle
- property alias rotateAxis: _rotate.axis
-
+ property real rotateAngle: 0.0
+ property vector3d rotateAxis: Qt.vector3d(1.0, 0.0, 0.0)
property vector3d center;
property vector3d normal;
readonly property vector4d equation: Qt.vector4d(normal.x,
@@ -61,8 +60,15 @@ Entity {
Transform {
id: transform
- Rotate { id: _rotate }
- Translate { translation: root.center }
+ matrix: {
+ var m = Qt.matrix4x4(1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1);
+ m.translate(root.center);
+ m.rotate(root.rotateAngle, root.rotateAxis);
+ return m;
+ }
}
property Layer layer: Layer {
diff --git a/examples/qt3d/clip-planes-qml/ClippingPlanes.qml b/examples/qt3d/clip-planes-qml/ClippingPlanes.qml
index a5525f667..15ab76110 100644
--- a/examples/qt3d/clip-planes-qml/ClippingPlanes.qml
+++ b/examples/qt3d/clip-planes-qml/ClippingPlanes.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
+import QtQuick 2.4 as QQ2
import Qt3D.Core 2.0
import Qt3D.Render 2.0
-import QtQuick 2.4 as QQ2
Entity {
id: root
diff --git a/examples/qt3d/clip-planes-qml/main.qml b/examples/qt3d/clip-planes-qml/main.qml
index c4436a2df..b7bcd5adb 100644
--- a/examples/qt3d/clip-planes-qml/main.qml
+++ b/examples/qt3d/clip-planes-qml/main.qml
@@ -34,6 +34,7 @@
**
****************************************************************************/
+import QtQuick 2.4 as QQ2
import Qt3D.Core 2.0
import Qt3D.Render 2.0
@@ -87,8 +88,8 @@ Entity {
}
property Transform transform: Transform {
- Translate { dx: 0 }
- Scale { scale: 3 }
+ translation: Qt.vector3d( 0.0, 0.0, 0.0 )
+ scale: 3
}
property Layer layer: Layer {