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.
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.
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!
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
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.
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.
© 2022 - 2024 — McMap. All rights reserved.