summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/bigmodel-qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qt3d/bigmodel-qml')
-rw-r--r--examples/qt3d/bigmodel-qml/MyEntity.qml7
-rw-r--r--examples/qt3d/bigmodel-qml/main.qml1
2 files changed, 7 insertions, 1 deletions
diff --git a/examples/qt3d/bigmodel-qml/MyEntity.qml b/examples/qt3d/bigmodel-qml/MyEntity.qml
index df0dbd13d..9b2b32c5a 100644
--- a/examples/qt3d/bigmodel-qml/MyEntity.qml
+++ b/examples/qt3d/bigmodel-qml/MyEntity.qml
@@ -36,15 +36,20 @@
import Qt3D.Core 2.0
import Qt3D.Render 2.0
+import Qt3D.Input 2.0
Entity {
id: root
+ property string name: "Entity"
property alias position: transform.translation
property alias diffuse: material.diffuse
components: [
Transform { id: transform },
SphereMesh { radius: 2 },
- PhongMaterial { id: material }
+ PhongMaterial { id: material },
+ ObjectPicker {
+ onClicked: console.log("Clicked", root.name, pick.distance, pick.triangleIndex)
+ }
]
}
diff --git a/examples/qt3d/bigmodel-qml/main.qml b/examples/qt3d/bigmodel-qml/main.qml
index 18597f1f5..1266f8e9c 100644
--- a/examples/qt3d/bigmodel-qml/main.qml
+++ b/examples/qt3d/bigmodel-qml/main.qml
@@ -81,6 +81,7 @@ Entity {
model: entityModel
delegate: MyEntity {
id: myEntity
+ name: "E" + index
property real _lightness: 0.2 + 0.7 / collection._rows * Math.floor(index / collection.cols)
property real _hue: (index % collection.cols) / collection.cols
position: Qt.vector3d(collection.spacing * (index % collection.cols - 0.5 * (collection.cols - 1)),