node-3d/3d-core-raub

Question about GUI

Luka-2005 opened this issue · 2 comments

Hi, I am quite new to 3D stuff in nodejs and really interested. So since the document createElement is limited to canvas for webgl, how can I create an gui? I am looking for a way on how to write the frames per second to the display and also how to create an user interface. How could I do that? Are there any addons? Thanks for your time :)

raub commented

Hi. There are different approaches on how you could implement the GUI. The createElement you've mentioned is only there for compatibility with the webgl interfaces, used by threejs for example. So disregard that.

Using this library, you normally get the 3D part out of the box, but nothing else. So, you can also render 3D symbols with threejs - https://threejs.org/examples/?q=text#webgl_geometry_text_shapes, although this doesn't sound efficient, it still works.

The more complex option is to have a 2D renderer. Render the UI on a texture and then overlay it on the screen, OR on any object inside the scene. At some point I was able to come up with this solution: https://github.com/node-3d/3d-qml-raub - please see if it works for you. This may still be a huge overkill, and you may find yourself better off with something like a texture-atlas-font with a rudimentary layout system.

Okay, thanks. I will try that out :)