[Interest] Centering camera on bounding volume change in Qt3D

Mike Krus mike.krus at kdab.com
Fri Apr 14 22:28:16 CEST 2023



> On 26 Mar 2023, at 17:34, Maxime Roussin-Bélanger <maxime.roussinbelanger at gmail.com> wrote:
> 
> On Sun, Mar 26, 2023 at 3:35 AM Mike Krus <mike.krus at kdab.com> wrote:
>> 
>> But doesn’t the system know you are changing the entities?
>> You say mouse click changes the entities, what does it do exactly, are you using a QObjectPicker or something?
> 
> 
> No QObjectPicker, well maybe in the future, but at the moment we are
> only using menus, but I was curious how to find
> the whole bounding volume of the scene, but I think we can simplify it.
> 
> Imagine instead of the whole scene we have `Qt3DCore::QGeometry`; on
> this object, we have
> {min,max}ExtentChanged. Instead, I would like to listen to the
> bounding volume changed signal instead of being double-tapped by
> those two signals. I found https://bugreports.qt.io/browse/QTBUG-54584
> which would be helpful for something
> we are trying to do.
I’ve updated that ticket with info on what was added since it’s creation.

> If we can get the entity bounding sphere changed signal I don't think
> I would need it on the scene.\
Could listen to QGeometry::minExtentChanged signals…

But again, from your menu action, you could first change the geometry and then tell the camera to recenter (might have to delay that a short while, Qt3D asynchronously updates bounding volumes).



Mike

> Max.
> 
> 
>> 
>> Mike
>> 
>> 
>>> On 26 Mar 2023, at 07:38, Maxime Roussin-Bélanger <maxime.roussinbelanger at gmail.com> wrote:
>>> 
>>> On Sat, Mar 25, 2023 at 11:55 AM Mike Krus <mike.krus at kdab.com> wrote:
>>>> 
>>>> 
>>>> 
>>>>> On 25 Mar 2023, at 15:04, Maxime Roussin-Bélanger <maxime.roussinbelanger at gmail.com> wrote:
>>>>> 
>>>>> Hello,
>>>>> 
>>>>> The entity change is caused by user input, the user moves the mouse over the entity and changes its shape, or it can use
>>>>> a menu to change the entity shape. I think I would have to inject the camera into _every_ entity object?
>>>> If the user moves the mouse, something in your application must be changing the shape, that can also reset the camera…
>>>> I think I need example code of what you are trying to achieve.
>>>> 
>>> 
>>> I don't want my entities to know about the camera, ideally, I would
>>> like the system, qt, to tell me that the bounding sphere has changed
>>> in some ways.
>>> 
>>> Max.
>>> 
>>>> 
>>>> Mike
>>>> 
>> 
>>>> Mike Krus | mike.krus at kdab.com | Senior Software Engineer & Teamlead
>> KDAB (UK) Ltd., a KDAB Group company
>> Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
>> KDAB - The Qt Experts, C++, OpenGL Experts
>> 

—
Mike Krus | mike.krus at kdab.com | Senior Software Engineer & Teamlead
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts



More information about the Interest mailing list