Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, August 2007
Qt interfaces inside OpenGL viewport?


Message 1 in thread

Is that possible? Let me clarify my question.

I've been asked to rewrite from scratch an application that lets the
user manipulate and visualize 3D datas (so to speak, molecules and
such). That application was written specifically for Win32 and used
DirectX. It had a viewport in which you could edit datas and all the
changes reflected immediately in the DX viewport.

Now I've been asked to make it run on Linux as well as on Windows and
maybe MacOS X - not required, though - so I thought that Qt would have
played well its part in the game. I've also been asked if it's
possible to make the 3D viewport run fullscreen while having a sort of
OSD user interface to work directly in the fullscreen viewport. Now I
know it may be possible to build simple GUIs with GLUT but the GUI
they currently use is quite advanced and I really don't know very much
about building GUIs with GLUT.

It would be great if there's the possibility to render a Qt dialog
into a pixmap and use it as a texture for quads in the OGL viewport,
sort of billboard, I guess.

Is that possible? Is there a better solution? I'm open to suggestions.

-- 
 [ signature omitted ] 

Message 2 in thread

Forgetting to ask if there's also a way to interact with the rendered GUI :-)

--
 [ signature omitted ] 

Message 3 in thread

If you want to overlay 2d graphics / gui controls over an opengl widget the 
only practical way you have is to do it all inside a QGLWidget (to answer 
your queston: it can be fullsceen, of course).

I think grabbing a dialog into a pixmap and then applying that texture to a 
quad is not a good option, because you lose the interaction.

My suggestion is to use the GraphicsView framework (seek in 'assistant') and 
use a QGLWidget as viewport. That way you can:
 - create 3d QGraphicsItems and place your own OpenGL rendering code inside 
the paint(..) function
 - create 2d QGraphicsItems and use the QPainter to draw all the graphics you 
want (the qpainter will be the the opengl painter, since the viewport is a 
QGLWidegt)
 - use the already existing interaction code (mouse/drag/other events) on all 
the qgraphicsitems and the view
 - you'll be ready when it will be possible to insert qwidgets inside the 
graphicsview (and that will simplify your life even more!)

Is that simple enough? ;-)
Enrico

On Tuesday 14 August 2007 14:18:13 Andrea Franceschini wrote:
> Is that possible? Let me clarify my question.
>
> I've been asked to rewrite from scratch an application that lets the
> user manipulate and visualize 3D datas (so to speak, molecules and
> such). That application was written specifically for Win32 and used
> DirectX. It had a viewport in which you could edit datas and all the
> changes reflected immediately in the DX viewport.
>
> Now I've been asked to make it run on Linux as well as on Windows and
> maybe MacOS X - not required, though - so I thought that Qt would have
> played well its part in the game. I've also been asked if it's
> possible to make the 3D viewport run fullscreen while having a sort of
> OSD user interface to work directly in the fullscreen viewport. Now I
> know it may be possible to build simple GUIs with GLUT but the GUI
> they currently use is quite advanced and I really don't know very much
> about building GUIs with GLUT.
>
> It would be great if there's the possibility to render a Qt dialog
> into a pixmap and use it as a texture for quads in the OGL viewport,
> sort of billboard, I guess.
>
> Is that possible? Is there a better solution? I'm open to suggestions.


 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 La soluzione per vendere o coprare qualcosa, la trovi su Email.it Annunci! 
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6892&d=14-8

--
 [ signature omitted ] 

Message 4 in thread

On 8/14/07, Andrea Franceschini <therealmorpheu5@xxxxxxxxx> wrote:

> I've also been asked if it's
> possible to make the 3D viewport run fullscreen while having a sort of
> OSD user interface to work directly in the fullscreen viewport.

MythTV does exactly this (Qt widgets as an OSD inside an OpenGL
window), but I'm not exactly sure how it's implemented. Also, it's
done using Qt 3.


-- 
 [ signature omitted ] 

Message 5 in thread

> Subject: Qt interfaces inside OpenGL viewport?
> 
> Is that possible? Let me clarify my question.

This might be something that is going to come with Qt 4.4:
http://labs.trolltech.com/blogs/2007/06/06/dialogs-on-the-canvas/

Cheers,
Peter

--
 [ signature omitted ] 

Message 6 in thread

May be not Qt?
It is possible using specialized libs for game gui (CEGUI for example)
and use Qt for core of application


2007/8/14, Andrea Franceschini <therealmorpheu5@xxxxxxxxx>:
>
> Is that possible? Let me clarify my question.
>
> I've been asked to rewrite from scratch an application that lets the
> user manipulate and visualize 3D datas (so to speak, molecules and
> such). That application was written specifically for Win32 and used
> DirectX. It had a viewport in which you could edit datas and all the
> changes reflected immediately in the DX viewport.
>
> Now I've been asked to make it run on Linux as well as on Windows and
> maybe MacOS X - not required, though - so I thought that Qt would have
> played well its part in the game. I've also been asked if it's
> possible to make the 3D viewport run fullscreen while having a sort of
> OSD user interface to work directly in the fullscreen viewport. Now I
> know it may be possible to build simple GUIs with GLUT but the GUI
> they currently use is quite advanced and I really don't know very much
> about building GUIs with GLUT.
>
> It would be great if there's the possibility to render a Qt dialog
> into a pixmap and use it as a texture for quads in the OGL viewport,
> sort of billboard, I guess.
>
> Is that possible? Is there a better solution? I'm open to suggestions.
>
> --
> Andrea Franceschini
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>


-- 
 [ signature omitted ]