Hi, I am creating a simple 3D viewer using QML and Qt3D. I just need to dynamically add objects to the surface of a mesh when the user clicks. I am using the SceneLoader component to load an obj file and its corresponding mtl file, but I can't seem to get an ObjectPicker component to work alongside the SceneLoader.
Is ObjectPicker supposed to work along side a SceneLoader component? Is it more likely that the click event just isn't making it to the ObjectPicker? In the example code below, replacing the SceneLoader with a SphereMesh works. Any insight would be appreciated. Item { id: modelViewerItem anchors.fill: parent visible: true property vector3d defaultCameraPosition: Qt.vector3d(0.0, 0.0, 300.0) property vector3d defaultCameraViewCenter: Qt.vector3d(0.0, 0.0, 0.0) Rectangle { id: scene anchors.fill: parent Scene3D { id: scene3d anchors.fill: parent anchors.margins: 0 aspects: ["input", "render", "logic"] cameraAspectRatioMode: Scene3D.AutomaticAspectRatio Entity { id: sceneRoot Camera { id: camera projectionType: CameraLens.PerspectiveProjection fieldOfView: 45 nearPlane : 0.1 farPlane : 1000.0 position: defaultCameraPosition upVector: Qt.vector3d(0.0, 1.0, 0.0) viewCenter: defaultCameraViewCenter } components: [ RenderSettings { activeFrameGraph: ForwardRenderer { camera: camera } }, InputSettings { } ] Entity { id: faceEntity components: [ SceneLoader { id: faceScene source: "file:///D:/generatedModel.obj" }, ObjectPicker { id: picker onClicked: { console.log("Picked") } }, Transform { id: faceTransform translation: Qt.vector3d(0, 0, 30) } ] } Entity { id: spotLight components: [ Transform { id: spotLightTransform translation: camera.position }, SpotLight { id: mainLight parent: camera enabled: true intensity: 1.5 localDirection: Qt.vector3d(0,0,0) } ] } } } } } Thanks for your help, Eric _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest