Using CEGUI as GUI in 3D [Solved, with images]

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

tx
Just popping in
Just popping in
Posts: 15
Joined: Mon Jan 15, 2007 02:42

Using CEGUI as GUI in 3D [Solved, with images]

Postby tx » Mon Jan 15, 2007 14:19

Hi!

First of all ive used CEGUI once briefly in a former project, but I don't have much indept knowledge about the limitations of CEGUI.

My new project is going to use a gui api on screen inside the 3d world. There is going to be several screens running at the same time.

What I was thinking about was if I could change the rendering target of CEGUI to a texture and then place it on the quad in 3d space. Then I would have to translate the 3d picking into the texture space of the quad. And connect all input through that.

My question is, would this be possible? First of all changing rendering surface to a texture, and then have several layouts and instances of the gui active.

Would I be better of writing my own stuff? Or maybe even change some in CEGUI's code?

I tried to search for something similiar, but couldn't find anything. But then again im a crappy searcher. :lol:
Last edited by tx on Thu Jan 18, 2007 16:10, edited 1 time in total.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Mon Jan 15, 2007 17:38

Are you saying that you want to render the GUI in 3D, such as on one face of a cube that can rotate?

The "traditional" approach to a GUI is to draw it on top of the 3D world, always facing the camera.

>> There is going to be several screens running at the same time

Do you mean split screens? You can have multiple dialogs (Cegui::FrameWindow) active at once. What you would need to do is prevent each from leaving its region. One easy solution would be to create a fullscreen Cegui::Sheet having one Cegui::DefaultWindow per split.

For example, a 4x4 grid layout:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<GUILayout >
    <Window Type="DefaultWindow" Name="Grid_4x4" >
        <Property Name="InheritsAlpha" Value="False" />
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
        <Window Type="DefaultWindow" Name="Grid_4x4/Cell_1x1" >
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0.5,0},{0.5,0}}" />
        </Window>
        <Window Type="DefaultWindow" Name="Grid_4x4/Cell_1x2" >
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.5,0},{0,0},{1,0},{0.5,0}}" />
        </Window>
        <Window Type="DefaultWindow" Name="Grid_4x4/Cell_2x1" >
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0,0},{0.5,0},{0.5,0},{1,0}}" />
        </Window>
        <Window Type="DefaultWindow" Name="Grid_4x4/Cell_2x2" >
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.5,0},{0.5,0},{1,0},{1,0}}" />
        </Window>
    </Window>
</GUILayout>


You would then add dialogs to one of the cells, such as "Grid_4x4/Cell_2x2" for the cell in the lower right. This dialog would be clipped by its parent, preventing it from appearing in a different cell.

Is this making sense or am I off the mark?

tx
Just popping in
Just popping in
Posts: 15
Joined: Mon Jan 15, 2007 02:42

Postby tx » Mon Jan 15, 2007 19:24

I don't want to render it on top of everything else. I want to render it to a texture then apply it to a side of a box for example. I might be able to render it first then take the backbuffer and copy it to a texture then clear the backbuffer and render the world. But im not sure thats very effecient.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Mon Jan 15, 2007 20:52

That approach is beyond my knowledge. Maybe the answer lies in the renderer code (DirectX9GUIRenderer.cpp for example).

tx
Just popping in
Just popping in
Posts: 15
Joined: Mon Jan 15, 2007 02:42

Postby tx » Mon Jan 15, 2007 22:05

Good idea, ill try checking it out.

tx
Just popping in
Just popping in
Posts: 15
Joined: Mon Jan 15, 2007 02:42

Postby tx » Thu Jan 18, 2007 01:59

So here is the first results, so far ive been able to render it onto a texture. Next step is to get more surfaces to add windows too.

Image

tx
Just popping in
Just popping in
Posts: 15
Joined: Mon Jan 15, 2007 02:42

Postby tx » Thu Jan 18, 2007 16:10

Progress, it's now possible to run multiple windows, each "screen" capturing a window and it's children.

But only one window can have input focus.

But as the left is parent to the right moving the smallest window on left will move the small window in the right.

Pressing right mouse button will swap input focus from left to right or the opposite.

Image

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Thu Jan 18, 2007 17:16

Please consider creating a Wiki for this. It's quite an effect.

tx
Just popping in
Just popping in
Posts: 15
Joined: Mon Jan 15, 2007 02:42

Postby tx » Thu Jan 18, 2007 18:24

Rackle wrote:Please consider creating a Wiki for this. It's quite an effect.

Sure I will consider that but im going to do some more testing first, so I can get the most efficient solution.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Wed Jan 24, 2007 01:16

This looks like great work ! a few users already asked for this but never did it. nice. I look forward for the wiki ;)

User avatar
Taharez
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Mon Mar 07, 2005 19:06
Location: Sweden
Contact:

Postby Taharez » Thu Jan 25, 2007 08:42

Coolness :) Definatly a nice effect, I too think it's one for the wiki. Any chance for more details on the project you're using this for?

tx
Just popping in
Just popping in
Posts: 15
Joined: Mon Jan 15, 2007 02:42

Postby tx » Mon Jan 29, 2007 01:44

Taharez wrote:Coolness :) Definatly a nice effect, I too think it's one for the wiki. Any chance for more details on the project you're using this for?


Well yeah, im going to use it for a game im making. The "game" is a spaceship exploring the internet. At the bridge of the spaceship there will be different terminals containing scripted programs. Looking alot like Star Trek.

At the end the user will be able to to develop their own programs, spaceships and game scripts..

There will be more information on www.txdev.net soon :lol:

Hard to describe this project in such few words..

User avatar
Taharez
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Mon Mar 07, 2005 19:06
Location: Sweden
Contact:

Postby Taharez » Mon Jan 29, 2007 15:38

Sounds like a very original concept :)

cybereality
Just popping in
Just popping in
Posts: 1
Joined: Fri Mar 02, 2007 02:51
Location: the matrix

Postby cybereality » Fri Mar 02, 2007 05:50

Nice screenshots, looking good man. I remember how impressed I was the first time I played DOOM3 and saw a working 3d GUI. It s cool to see that CEGUI can be used for this type of effect.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: Google [Bot] and 2 guests