3D GUI, integrating GUI into Ogre scene?


17-01-2014 11:30:27

I've seen there are some neat 3D GUI demos, but I don't know anything about how this works. Is it possible to actually integrate a GUI into your 3D Ogre scene?

Examples of what I mean would be to put regular 2D MyGUI controls on a flat surface which is part of a 3D model, say you walk up to a wall-panel and see buttons, sliders, etc you can interact with, I guess rendered to a texture which is painted on the wall.
Or to use an existing 3D mesh as a button... you click it and it triggers a regular MyGUI event trigger.

I'm specifically interested in this being integrated into your models/scene, not just floating 3D GUI on top, so that if you had control buttons on a tank, and the tank moved, the buttons would move automatically since they're part of the model somehow.

Is this possible in some way or would it be better just writing separate picking system? I was thinking being able to connect a 3D picking system to standard MyGUI event system would be pretty nice so you only have one event system to work with across 2D and 3D GUIs.


17-01-2014 14:58:31

Here's how it is usually done:
You render GUI into texture and then use it as a material for mesh. For a proper clicking in 3d you need custom picking logic, but this is implemented in one of our demos.
Here's what you can get as result:


07-05-2014 14:12:51

Hello simed,

do you have solved your problem? I am still searching a working example for a similar task (trying to render a MyGUI-window into a texture to use for an ogre object), so please share your code with us :)

Kind regards
- Corak


07-05-2014 14:21:01

I'm afraid this isn't something we needed to do yet. As mentioned there is a demo and I think making MyGUI render to any texture/viewport is not a big challenge based on my understanding, but I haven't tried.