[Development] Stand alone scene graph module

Sletta Gunnar Gunnar.Sletta at digia.com
Wed Apr 3 13:09:06 CEST 2013


On Apr 3, 2013, at 12:19 PM, Rutledge Shawn <Shawn.Rutledge at digia.com>
 wrote:

> 
> On 3 Apr 2013, at 11:25 AM, Sletta Gunnar wrote:
> 
>> Qt3D in its current state is more like QGraphicsView. It puts items into a scene and renders them without any logic to try to improve on the performance. It does contain a scene graph, but it is purely procedural in its execution. Sean Harmer posted a mail a while back outlining how he envisions Qt3D evolving into a proper 3D engine, something which will be suitable for larger 3D apps. This solves a different usecase from what the scene graph and will not be suitable for UI rendering, for instance.
> 
> What happens when you try to combine the two, are they just in layers?  

If you want to mix them, the answer would be to use the public API already available in Qt Quick, it has always been there, available for use. What the changes do so far is that to extract what is public API in Qt Quick into a separate module, not depending on libQtQuick, libQtQML nor libQtV8. It also opens up for using one or two private headers to customize things even further.

> For example I tried to make a piano app as a multi-point touch demo, and found it difficult to make fake semi-3D-looking piano keys.  One can rotate a Rectangle in any direction around any axis, so I thought I could have a 90-degree rotated rectangle for the front of the key, and a rotated woodgrain texture for the sides.  But when you rotate to 90 degrees, it disappears, even if you then rotate the entire key by a few degrees.  I got something a little better by tweaking the angles slightly and tweaking the length heavily, but it didn't scale well.  So the ideal might be to render using a 3D model, but every key top should have a MultiPointTouchArea.  Or else the 2D scene graph should handle the rotated cases more realistically; is that doable, or is there not much hope because we want to avoid using perspective rendering in typical 2D apps?

A rectangle is a section of a 2D plane. When you rotate it by 90 degress over the x or y axis it becomes invisible. This is how it should be. If you instead created a custom scene graph item that represents a rectangular box, this would rotate more in line with what you want. You could even add a custom material to that so that it gets a nice lighting. 

As for handling the multitouch input, since the item is non-rectangular, would it not be better to handle the touch points in the QQuickItem::touchEvent handler?

cheers,
Gunnar


More information about the Development mailing list