16

I have fiddled around with OpenGL on Qt. But now I want to have complex scenes. (With multiple COLLADA/MD2 models loaded).

For this I'm thinking of using OpenSceneGraph (OSG). Is it possible to integrate OSG with Qt? If so how to?

Thanks.

coder9
  • 1,551
  • 1
  • 27
  • 51

4 Answers4

16

OpenSceneGraph has an osgQt library that makes it easy to integrate OpenSceneGraph within Qt. Head up to the the samples and specifically the osgviewerQt one!

Richard Jessop
  • 528
  • 7
  • 16
Mathieu Marache
  • 483
  • 1
  • 4
  • 8
1

Just to point out at another resource (which works with QOpenGLWidget): an article Making Qt and OpenSceneGraph play nice by Bastian Rieck. It will be useful for those who are interested in doing render of different scenes on different widgets while performing updates on demand only (without timer). The article has a link to a source code.

vicrucann
  • 1,515
  • 17
  • 30
1

Yes - I haven't worked on OSG for a year but there was a very good Qt widget in OSG that worked well enough for a commercial product.

With the new improvements in openGL in 4.8 it should be even better

You should probably search the osg forum

Martin Beckett
  • 90,457
  • 25
  • 178
  • 252
0

I wrote a simple class that derives from QOpenGLWidget, and can be used as a normal widget, that encapsulates osgViewer::GraphicsWindowEmbedded, and also (optionally) allows to use the mouse inside the widget to control the camera.

Its usage is as simple as:

#include <QApplication>
#include <QMainWindow>

#include "QtOSGWidget.h"

int main(int argc, char** argv)
{
    QApplication qapp(argc, argv);
    QMainWindow window;

    QtOSGWidget widget(&window);

    window.setCentralWidget(&widget);
    window.show();
    return qapp.exec();
}

It can be found on GitHub.

Equilibrius
  • 198
  • 11