Using Qt to render world space UI in a 3D application
-
Hi!
We are working on a VR application using a custom OpenGL renderer. Currently, we are using our own UI system to display an interface to the user in VR. We are considering upgrading this UI to use Qt if we can get it running. The UI is a flat plane in 3D that the user can interact with using the motion tracked controller as a laser pointer). Similar to the menu in SteamVR:
Basically, what we need is a way to render a Qt UI into an OpenGL framebuffer, so that we can display it on a world space quad. And we need to be able to simulate mouse events manually by raycasting from the motion controllers through the UI.
Searching for this topic, I mostly found guides on how to embed OpenGL rendering inside a 2D Qt GUI. Unfortunately, we need the exact opposite of that, i.e. embedding a 2D Qt GUI in a 3D OpenGL rendering.
Is this advisable (or even possible) to achieve or should we look for a different solution? Thank you!
-
I can't tell for sure however I doubt it. Widgets are not rendered through OpenGL. However, you can create a widget like UI using QtQuick.Controls 2 which is likely a better option if you want to have a nicely animated UI in your virtual world.