Hello,

I want to use Qt3D to do a 3D graph visualizer. I'm at the very beginning, studying if Qt3D could be a good option for me.

Among other, I want to print the names of the nodes in the 3D view (next to the nodes). These names should always face the camera, even if the camera moves. I have the feeling that Qt3DExtras::QText2DEntity is the class I should use. Unfortunately, its documentation is very succinct, and I can't find better example than what is shown here: https://blog.qt.io/blog/2017/05/24/qt3d/ (scroll to "Text Support").
I don't think I want to use the other mentioned text class (QExtrudedText...) as I don't want 3D text.

I tried this in C++:

Qt Code:
  1. auto *text2d = new Qt3DExtras::QText2DEntity(_rootEntity);
  2. text2d->setText("LOL!!!");
  3. text2d->setHeight(3);
  4. text2d->setWidth(3);
  5. text2d->setColor(Qt::green);
  6. text2d->setFont(QFont("Courier New", 10));
To copy to clipboard, switch view to plain text mode 

Unfortunately, nothing appears. From this video, it seems that the QText2DEntity class embed a mesh and a material, so I'm not supposed to add it (?): https://youtu.be/YP8alTWV_BI?t=17m38s

I also tried in QML, even if I want a C++ solution in the end (just to test). I changed the "simple-qml" example from Qt3D to this:

Qt Code:
  1. import QtQuick 2.2 as QQ2
  2. import Qt3D.Core 2.0
  3. import Qt3D.Render 2.0
  4. import Qt3D.Input 2.0
  5. import Qt3D.Extras 2.9
  6.  
  7. Entity {
  8. id: sceneRoot
  9.  
  10. Camera {
  11. id: camera
  12. projectionType: CameraLens.PerspectiveProjection
  13. fieldOfView: 45
  14. aspectRatio: 16/9
  15. nearPlane : 0.1
  16. farPlane : 1000.0
  17. position: Qt.vector3d( 0.0, 0.0, -40.0 )
  18. upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
  19. viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
  20. }
  21.  
  22. OrbitCameraController {
  23. camera: camera
  24. }
  25.  
  26. components: [
  27. RenderSettings {
  28. activeFrameGraph: ForwardRenderer {
  29. clearColor: Qt.rgba(0, 0.5, 1, 1)
  30. camera: camera
  31. }
  32. },
  33. // Event Source will be set by the Qt3DQuickWindow
  34. InputSettings { }
  35. ]
  36.  
  37. Text2DEntity {
  38. id: text
  39. text: "Hello World"
  40. width: 20
  41. height: 10
  42. color: Qt.red
  43. }
  44. }
To copy to clipboard, switch view to plain text mode 

But I have the same problem: nothing appears...

What am I doing wrong? Do you have any inputs on this class?
Thanks for any help