[Interest] Picking in Quick3D custom models and mapFrom3DScene() question

joao morgado joaodeusmorgado at yahoo.com
Fri Jun 11 02:32:03 CEST 2021

After checking the qt source code, I found that I have to explicit set the camera in View3D:
camera: OrthographicCamera{            id: mainCamera            z: 300        }
Now it works
CheersJoão    Em quinta-feira, 10 de junho de 2021 18:45:29 GMT+1, joao morgado via Interest <interest at qt-project.org> escreveu:  
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

Interest mailing list
Interest at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210611/18bfc83a/attachment.html>

More information about the Interest mailing list