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

Oleg Evseev ev.mipt at gmail.com
Tue Dec 18 13:38:49 CET 2018


Hi Volker,

Yes, you have to add custom material because Qt3DRender::QShaderProgram s
of default materials are inside private class, so you can't change shaders'
code source.

Take a look at https://codereview.qt-project.org/#/c/182053/ (that was for
including in qt 3d, but you could easily use it as custom material in your
own app) and adopt it accordingly to Text2DMaterial.

---
With regards, Oleg

вт, 18 дек. 2018 г. в 15:07, Volker Enderlein <
volker.enderlein at ifm-chemnitz.de>:

> 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
>
> --
>
> _______________________________________________
> 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/20181218/83f3ebb8/attachment.html>


More information about the Interest mailing list