[Interest] Qt3D How to draw 2D-Text always facing the Camera

david crémoux david at adeko.com
Wed Dec 19 08:37:36 CET 2018


You're welcome.

I will most probably have to implement the same feature in a near future 
for the project I'm currently working on.

If making the custom camera is too much complex, there is a more basic 
way but involving more data management (depending on how much 2d text 
entities you have to display):
You still use a specific frame graph branch with a layer filter but with 
an identity camera.
Then you attach all your 2d text entities to your scene root entity and 
you update their transform/position on every camera transform/move.

david

On 19-Dec-18 10:05, Volker Enderlein wrote:
> Hi David,
> 
> thanks for the answer. I wasn't thinking of that, as my knowledge about 
> framegraphs is very limited. But this helps me further.
> 
> Cheers Volker
> 
> Am 18.12.2018 um 14:53 schrieb david crémoux:
>> Hello Volker,
>>
>> I guess you can achieve it with regular QText2DEntity, with a specific 
>> frame graph branch in your rendering for your 2d text, a layer filter 
>> and a custom camera (based on your main camera).
>>
>> david
>>
>> On 18-Dec-18 14:37, Volker Enderlein wrote:
>>> Hi all,
>>>
>>> when building a rather complex Qt3D-Scene I needed some 2D-Text that 
>>> has a 3D position, is always facing the camera, and fixed in size, 
>>> independent of the camera settings.
>>>
>>> While looking over the components provided by Qt3D I stumbled across 
>>> Text2DEntity and thought about how it can be tweaked ot fulfill my 
>>> requirements.
>>>
>>> As all my requirements can be done inside a shader I thought about 
>>> whether the QText2DMaterial that is used inside the class can be 
>>> replaced by a custom material. But unfortunately the material is not 
>>> accessible from outside.
>>>
>>> Text2DEntity can be embedded in another class that applies the camera 
>>> information to it, but is there an easier solution to this problem?
>>>
>>> Cheers Volker
>>>
> 



More information about the Interest mailing list