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

joao morgado joaodeusmorgado at yahoo.com
Wed Jun 16 08:09:26 CEST 2021


Hi
As stated above, explicit setting the camera in View3D will make mapTo3DScene() work, but it will break the View3D display content. I have created a bug report 

[QTBUG-94539] mapTo3DScene() will fail when a camera is not explicit assigned - Qt Bug Tracker


| 
| 
|  | 
[QTBUG-94539] mapTo3DScene() will fail when a camera is not explicit ass...


 |

 |

 |

CheersJoão



 
    Em sexta-feira, 11 de junho de 2021 01:33:29 GMT+1, joao morgado via Interest <interest at qt-project.org> escreveu:  
 
  
Hi 
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:  
 
 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

_______________________________________________
Interest mailing list
Interest at qt-project.org
https://lists.qt-project.org/listinfo/interest
  _______________________________________________
Interest mailing list
Interest at qt-project.org
https://lists.qt-project.org/listinfo/interest
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210616/9ed348fb/attachment.html>


More information about the Interest mailing list