4

任何尝试过 Qt QML 和 3D OpenGL 的人,我都对我读过的 2 个框架感兴趣,但我不清楚它们是否实际上是同一个框架。Krzysztof Krzewniak 在 2013 年 Qt 开发者日视频演示中概述了两者中最有趣的部分:

http://www.youtube.com/watch?v=29wCpA0DBZI

虽然非常有趣,但不幸的是,我在网上其他任何地方都找不到这方面的源代码,甚至是所讨论的框架的名称。

有QtQuick3d:

http://doc.qt.digia.com/qt-quick3d-snapshot/

但是,我无法判断这实际上是在描述 Dev Days 中的相同框架,还是它们是独立的(并且显然有些相似)框架?与视频相比,我最初对 API 的看法表明它们是不同的,这对于 Qt 社区中的 2 个重要项目试图做同样的事情似乎是多余的。

任何对 QML 领域有一定了解的人都可以在这里提供一些指示吗?

4

3 回答 3

7

Right, so let us start with some history behind...

Qt was initially a 2D framework for rendering computer graphics UI for simple desktop applications.

Qt3D was developed earlier than qml became mature as an extension to the 2D world provided by the QtGui module, or even QtOpenGL.

It was a 3D Qt api for rendering 3D content on the screen. It had different aspects to deal with 3D objects, build them, put them on the screen, compute intersection, and so on.

The idea was to bring easy to create application concept into Qt rather than always going through QtOpenGL or lower-level API for creating games, simulators, cad applications, and so on.

enter image description here

Right, when QML came out and kept maturing, the Qt3D contributors in Brisbane thought that it would be nice to put a QML API on top of the existing Qt3D C++ API for easy use in QML application. That is how we come to QtQuick3D.

enter image description here

When Nokia decided to shut the Brisbane office done, the Qt3D module pretty much became unmaintained and abandoned only getting a few bugfixes from the community every now and then.

There is some work in progress by KDAB to re-architecture and re-design the module, but it is not mature yet, and it can be found in a separate branch.

The video you are referring to is not dealing with the unmaintained Qt3D module. Rather, it tries to build 3D based on the new scene graph introduced in Qt. Since, there is no Qt3D module working nicely with the new SG in Qt 5, people become pragmatic and move on. That is what you see in the video.

Now, as you can see this is not quite a duplication, but... In the future, the new Qt3D architecture might be acting better with the new scene graph. In fact, KDAB has put a lot of effort into bringing the OpenGL support into QtGui up to real world.

That was the foundation for the Qt3D module which will probably be used in the future (hopefully) by 3D applications written based on Qt, but in the meantime... the video shows how to build hardware accelerated 3D UI based on what we have today.

于 2014-04-26T11:46:25.563 回答
0

wiki 上有很多过时的信息,找到有用的信息和非过时的存储库是一件痛苦的事。所以这是我几个月前学到的:

正确的,据我所知,目前唯一有效的 git repo 是这样的:

git://gitorious.org/qt/qt3d.git

KDAB 正在进行一些工作......尚未成熟......在一个单独的分支中找到。” Laszlo Papp 的回答段落似乎是指wip/newapi branch,而master 分支似乎保持在可编译状态(意思是,我已经尝试过几次,YMMV)。Master 分支应该可以很好地使用 Qt3D,但看起来 API 会发生变化。

几个月前我在 Windows 8.0 上玩过它,MinGW 工具链与 SDK 一起安装,并使用原生完整的 OpenGL 驱动程序(我必须从 ATI 网站获取我的卡,默认的 Windows 驱动程序是不够的)。看起来它还没有腐烂,一个例子还在构建,我有一个月亮在这个屏幕上旋转。

它有README文件,它将告诉您如何构建它,从构建 Qt5 开始。这是另一个很好的链接,因为 qt3d README不是很全面。如果你在 Windows 上,只要跳过 Webkit 及其部门,除非你真的需要它,因为那些额外的部门可能有点麻烦。

于 2014-04-28T05:37:25.893 回答
0

这两个3d库不一样,你是对的。

您已经在线链接了很多关于 Qt3d 1.0 和 QtQuick 3d 的参考信息,它们是相似且相关的。

视频演示中的 OpenGL 工作要更新得多。它直接放在QSceneGraphQQuickWindow功能之上。

我的建议是不要使用本视频或 Qt3d/QtQuick3d 库中的方法。相反,等待 KDAB 完成 Qt3d 2.0(可能已经发布,您应该检查一下)。Qt3d 2.0 是一个完整的 QML 库,可让您执行此视频中演示的操作。(http://qt-project.org/wiki/Qt3D-wip-newapi-Overview,http://prezi.com/u-ewejoqxqj2/qt3d-20/_ _

于 2014-04-26T12:16:47.453 回答