将 OpenSceneGraph 与 Qt 集成
我在 Qt 上摆弄过 OpenGL。但现在我想要复杂的场景。 (加载了多个 COLLADA/MD2 型号)。
为此,我正在考虑使用 OpenSceneGraph (OSG)。 是否可以将 OSG 与 Qt 集成?如果是这样怎么办?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
OpenSceneGraph 有一个 osgQt 库,可以轻松地将 OpenSceneGraph 集成到 Qt 中。前往示例,特别是 osgviewerQt一!
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!
是的 - 我已经有一年没有在 OSG 上工作了,但是 OSG 中有一个非常好的 Qt 小部件,对于商业产品来说已经足够好了。
随着 4.8 中 openGL 的新改进,它应该会更好
您可能应该搜索 osg 论坛
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
只是指出另一个资源(与 QOpenGLWidget 一起使用):一篇文章 Making Qt and OpenSceneGraph巴斯蒂安·里克(Bastian Rieck)演奏得很好。对于那些有兴趣在不同小部件上渲染不同场景同时仅执行按需更新(没有计时器)的人来说,这将非常有用。这篇文章有一个源代码的链接。
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.
我编写了一个从 QOpenGLWidget 派生的简单类,可以用作普通小部件,它封装了 osgViewer::GraphicsWindowEmbedded,并且还(可选)允许使用小部件内的鼠标来控制相机。
它的用法非常简单:
可以在 GitHub 上找到它。
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:
It can be found on GitHub.