<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div class="ydp467a48a1yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" dir="ltr" data-setdir="false"><div>Hi</div><div><br></div><div dir="ltr" data-setdir="false">As stated above, explicit setting the camera in View3D will make <span>mapTo3DScene() work, but it will break the View3D display content. I have created a bug report <span><br></span></span></div><div dir="ltr" data-setdir="false"><span><span><br></span></span></div><div dir="ltr" data-setdir="false"><span><a href="https://bugreports.qt.io/browse/QTBUG-94539" rel="nofollow" target="_blank" class="enhancr_card_4522701214">[QTBUG-94539] mapTo3DScene() will fail when a camera is not explicit assigned - Qt Bug Tracker</a><br></span><div><br></div><div id="ydpa3fa6803enhancr_card_4522701214" class="ydpa3fa6803yahoo-link-enhancr-card ydpa3fa6803yahoo-link-enhancr-not-allow-cover ydpa3fa6803ymail-preserve-class ydpa3fa6803ymail-preserve-style" style="max-width:400px;font-family:YahooSans, Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif" data-url="https://bugreports.qt.io/browse/QTBUG-94539" data-type="YENHANCER" data-size="MEDIUM" contenteditable="false"><a href="https://bugreports.qt.io/browse/QTBUG-94539" style="text-decoration-line: none !important; text-decoration-style: solid !important; text-decoration-color: currentcolor !important; color: rgb(0, 0, 0) !important;" class="ydpa3fa6803yahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table class="ydpa3fa6803card-wrapper ydpa3fa6803yahoo-ignore-table" style="max-width:400px" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td width="400"><table class="ydpa3fa6803card ydpa3fa6803yahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td><table class="ydpa3fa6803card-info ydpa3fa6803yahoo-ignore-table" style="background-color: rgb(255, 255, 255); background-repeat: repeat; background-attachment: scroll; background-image: none; background-size: auto; position: relative; z-index: 2; width: 100%; max-width: 400px; border-radius: 0px 0px 2px 2px; border-top: 1px solid rgb(224, 228, 233);" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px"></td><td style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:YahooSans, Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;border-radius:0 0 2px 0"><h2 class="ydpa3fa6803card-title" style="font-size: 14px; line-height: 19px; margin: 0px 0px 6px; font-family: YahooSans, Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif; color: rgb(38, 40, 42); max-width: 314px;">[QTBUG-94539] mapTo3DScene() will fail when a camera is not explicit ass...</h2><p class="ydpa3fa6803card-description" style="font-size: 12px; line-height: 16px; margin: 0px; color: rgb(151, 155, 167);"></p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div>Cheers</div><div dir="ltr" data-setdir="false">João<br></div><div><br></div><div><br></div></div><div dir="ltr" data-setdir="false"><span><br></span></div><div dir="ltr" data-setdir="false"><span> </span></div><div><br></div>
        
        </div><div id="yahoo_quoted_3882848753" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    Em sexta-feira, 11 de junho de 2021 01:33:29 GMT+1, joao morgado via Interest <interest@qt-project.org> escreveu:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="yiv4745332266"><div><div class="yiv4745332266ydpf62ea48byahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div></div>
        <div><br clear="none"></div><div dir="ltr">Hi </div><div dir="ltr"><br clear="none"></div><div dir="ltr">After checking the qt source code, I found that I have to explicit set the camera in View3D:</div><div dir="ltr"><br clear="none"></div><div dir="ltr"><div><div dir="ltr" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">camera: OrthographicCamera{</div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">            id: mainCamera</div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">            z: 300</div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">        }</div></div><br clear="none"></div><div dir="ltr">Now it works</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Cheers</div><div dir="ltr">João</div>
        
        </div><div class="yiv4745332266yahoo_quoted" id="yiv4745332266yahoo_quoted_3978517419">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    Em quinta-feira, 10 de junho de 2021 18:45:29 GMT+1, joao morgado via Interest <interest@qt-project.org> escreveu:
                </div>
                <div><br clear="none"></div>
                <div><br clear="none"></div>
                <div><div class="yiv4745332266yqt6041353236" id="yiv4745332266yqt03722"><div id="yiv4745332266"><div><div class="yiv4745332266yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div dir="ltr">Hi</div><div dir="ltr"><br clear="none"></div><div dir="ltr">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). </div><div dir="ltr"><br clear="none"></div><div dir="ltr">Picking works with regular Models (Sphere, Cube, ...) but fails with my custom model.</div><div dir="ltr"><br clear="none"></div><div dir="ltr">IIRC picking is still not implemented in custom models ? Does anyone know current status of picking, if it is planned for Qt 6.2 ? </div><div dir="ltr"><br clear="none"></div><div dir="ltr">For now I will implement my own picking for custom models wich leads to my second question:</div><div dir="ltr"><br clear="none"></div><div dir="ltr">I'm getting an error trying to use View3D.mapToScene( ), my code is something like:</div><div dir="ltr"><br clear="none"></div><div dir="ltr"><div><div>View3D {</div><div>    id: view</div><div>    ...........</div><div>    OrthographicCamera{</div><div>            id: mainCamera</div><div>            z: 300</div><div>        }</div><div>    ...........</div><div>}</div><div><br clear="none"></div><div>MouseArea {</div><div>    id: ma</div><div>    anchors.fill: view</div><div><br clear="none"></div><div>    onMouseXChanged: {</div><div>        var pos3D = view.mapTo3DScene(Qt.vector3d(mouseX, mouseY, 0))</div><div>        console.log("pos3D: "+pos3D)</div><div>    }</div><div>}</div></div><div><br clear="none"></div><div dir="ltr">The error:</div><div dir="ltr"><span>QML View3D: Cannot resolve scene position without a camera assigned!</span><br clear="none"></div><div dir="ltr"><span><br clear="none"></span></div><div dir="ltr"><span><br clear="none"></span></div><div dir="ltr">Am I misunderstanding how to use <span><span style="color:rgb(0, 0, 0);font-family:Helvetica, Arial, sans-serif;font-size:16px;">mapTo3DScene, is this a bug, or what am I missing ?</span></span></div><div dir="ltr"><span><span style="color:rgb(0, 0, 0);font-family:Helvetica, Arial, sans-serif;font-size:16px;"><br clear="none"></span></span></div><div dir="ltr"><span><span style="color:rgb(0, 0, 0);font-family:Helvetica, Arial, sans-serif;font-size:16px;">Thank you</span></span></div><div dir="ltr"><span><span style="color:rgb(0, 0, 0);font-family:Helvetica, Arial, sans-serif;font-size:16px;">João</span></span></div><br clear="none"></div><div dir="ltr"><br clear="none"></div></div></div></div></div>_______________________________________________<br clear="none">Interest mailing list<br clear="none"><a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:Interest@qt-project.org" target="_blank" href="mailto:Interest@qt-project.org">Interest@qt-project.org</a><br clear="none"><a rel="nofollow noopener noreferrer" shape="rect" target="_blank" href="https://lists.qt-project.org/listinfo/interest">https://lists.qt-project.org/listinfo/interest</a><br clear="none"></div>
            </div>
        </div></div></div><div class="yqt6041353236" id="yqt28481">_______________________________________________<br clear="none">Interest mailing list<br clear="none"><a shape="rect" ymailto="mailto:Interest@qt-project.org" href="mailto:Interest@qt-project.org">Interest@qt-project.org</a><br clear="none"><a shape="rect" href="https://lists.qt-project.org/listinfo/interest" target="_blank">https://lists.qt-project.org/listinfo/interest</a><br clear="none"></div></div>
            </div>
        </div></body></html>