[Interest] Picking in Quick3D custom models and mapFrom3DScene() question
joao morgado
joaodeusmorgado at yahoo.com
Thu Jun 10 19:43:43 CEST 2021
Hi
I'm trying to pick a custom model in quick3D, the model is QQuick3DGeometry based with 4 vertexs with primitive TriangleStrip (basically I'm simulating a line with width).
Picking works with regular Models (Sphere, Cube, ...) but fails with my custom model.
IIRC picking is still not implemented in custom models ? Does anyone know current status of picking, if it is planned for Qt 6.2 ?
For now I will implement my own picking for custom models wich leads to my second question:
I'm getting an error trying to use View3D.mapToScene( ), my code is something like:
View3D { id: view ........... OrthographicCamera{ id: mainCamera z: 300 } ...........}
MouseArea { id: ma anchors.fill: view
onMouseXChanged: { var pos3D = view.mapTo3DScene(Qt.vector3d(mouseX, mouseY, 0)) console.log("pos3D: "+pos3D) }}
The error:QML View3D: Cannot resolve scene position without a camera assigned!
Am I misunderstanding how to use mapTo3DScene, is this a bug, or what am I missing ?
Thank youJoão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210610/1dc42d6b/attachment-0001.html>
More information about the Interest
mailing list