QML/3D Demo

Published Tuesday August 10th, 2010 | by

With the imminent release of QML in Qt 4.7 it seems like the perfect time to let you all in on what we in the weird world of graphics have been working on to support this new paradigm for Qt development.

You may remember that way back in November ’09 there was a blog post describing Qt/3D. Qt/3D, as you know, is a set of tools and functions which make coding of 3d graphics quicker and easier within the Qt framework. Many of the core elements (enablers, and so on) of Qt/3D have already found their way into Qt, with more fun and excitement upcoming in the near future as new functionality is introduced and more people start playing with 3d in Qt.

In that same post QML/3D was very briefly mentioned as a ‘next logical step’ for developing 3d applications in Qt. Since that time we’ve made good on this idea and have a functioning prototype of QML/3D up and running.

It’s important to note that this is far from a fully rounded application development framework. It does, however, prove that 3d content can be quickly and easily added to applications, and that with Qt3d providing the heavy lifting in the background, content rich graphical applications are within the reach of even the novice developer.

So without further ado, here’s a quick peek at what it’s like to develop in QML/3D:

    Where To Next?

QML/3D still has a long way to go. Right now it’s a great way of putting 3d ‘toys’ into an application, and providing limited functionality, but it is by no means an all around solution to 3d applications and interfaces.

In coming months we plan to more closely integrate QML/3D into the standard QML framework and provide the kind of capabilities and conveniences which will make development of productive and useful applications in QML/3D just as quick and easy as they are in QML.

The most important thing, however, is for you – the community – to play with QML/3D (and Qt/3D) and tell us what you’d like to see added to and taken away from it, or what you want to be able to do with it!

So in the meantime, happy coding, and stay tuned for more QML/3D news in coming months.

Did you like this? Share it:

Posted in Graphics, OpenGL, Qt Quick

31 comments to QML/3D Demo

Sohail says:

Wow, great demo. QML is really coming along!

BeGo says:

Penguin doing Kecak Dance (http://en.wikipedia.org/wiki/Kecak)? Very nice!!!

Still waiting when QML published.

Kensai says:

If it is really as easy as it looks, we’re gonna have a hell of fantastic tool for 3D graphics and animation.

Sean Harmer says:

This really looks like a nice way of specifying a 3D scenegraph. I’ll check out the code later today. I take it this uses the Qt-scenegraph project in the implementation? Is it possible to reference {vertex|geometry|pixel} shaders from the qml document yet? I’m looking forward to see how this project evolves over the coming months.

BlackCoder says:

I am loved that simple tutorials, you have no idea how many times I had to bang my head against the wall trying to debug an OpenGL low level issues, not even to mention portability. My concern here is that this is all pure QML, can any of these be actually coded ? A lot of time you want to generate dynamic content and not just pre-code it in QML, are you offering any alternative for that ?

Regards

sandsmark says:

I see you have 3ds model loading, do you have/are you planning support for Collada (or other less restrictive formats)?

muenalan says:

Are the 3d objects already clickable/selectable etc ?

vpicaver says:

I’m interested to see how the trolls are planning on describing 3D interaction with qml.

Tim Kelly says:

Most entertaining coding demo I’ve ever seen.

scorp1us says:

*jawdrop*

Will this come out with 4.7? Or be an add-on library for 4.7, that will be included in 4.8?
Can you define “imminent”? As in later this month, or next?

NuShrike says:

Is Qt going to be cleaned up to consolidate all of its redundant graphical paths, esp those not used? For instance if we’re using exclusively QML and 3D, the 2D widgets, 2D rasterer, and non-OpenGL code paths are still there, taking up a LOT of room (in QtGUI.dll) for instance.

This may not matter on desktops, but in Mobile and especially in Windows Mobile and Embedded, 3MB Core + 9MB Gui + QML support + threed + system = ~16MB of ram used. When the environment has maybe 32MB of ram per process or total, half of it gobbled up by Qt with major sections being legacy, unused code-paths is Ridiculous. And this is after qconfig shaving.

Is it the same weighty issues similiar to MFC where the class-inheritance hierarchy adds a lot of overhead when Curiously Recurring Template Pattern could lighten it up a large magnitude as WTL does?

charleyb says:

Very nice demo. Quite impressive. I like the incremental adding of complexity as the whole file is built-before-your-very-eyes (really nice presentation pace, great content).

I’d similarly be very interested in a future demo of clickable/selectable interactivity, and programatically creating/generating the 3d objects …

Sean Harmer: “I take it this uses the Qt-scenegraph project in the implementation?”

At the moment it works with the QGraphicsView-based implementation of QML that will be shipped with Qt 4.7, so no scenegraph required (yet). We will of course change the back-end implementation when QML/2D does.

Sean: “Is it possible to reference {vertex|geometry|pixel} shaders from the qml document yet?”

Vertex and fragment shaders, yes! The “ShaderProgram” item can be used to define an effect with raw shader code, and even hook its uniform variables up to QML animation items. See “demos/declarative/teapot-shader-animation.qml” in the Qt/3D source tree. We’re working on some better tutorial material for this – stay tuned!

BlackCoder: “My concern here is that this is all pure QML, can any of these be actually coded ? A lot of time you want to generate dynamic content and not just pre-code it in QML, are you offering any alternative for that ?”

QML has mechanisms already for generating QML items on the fly. They should “just work” with QML/3D. http://doc.trolltech.com/4.7-snapshot/qml-qt.html#dynamic-object-creation

sandsmark: “I see you have 3ds model loading, do you have/are you planning support for Collada (or other less restrictive formats)?”

We have a little bit of support for COLLADA-FX, and we’ve discussed expanding that to full COLLADA, but it is a very big spec. Any assistance we can get from the community for that would be appreciated (it is fairly easy to add a new model loader – http://doc.qt.nokia.com/qt3d-snapshot/sceneformats-obj.html). Blender support would also be cool.

muenalan: “Are the 3d objects already clickable/selectable etc ?”
vpicaver: “I’m interested to see how the trolls are planning on describing 3D interaction with qml.”

See the “teaservice.qml” demo in the Qt/3D sources for the basic clickable/selectable stuff we have implemented at the moment. We’re also investigating how to write more complex interaction styles directly in JavaScript using a QML MouseArea. It’s still a hot topic for research right now.

scorp1us: “Will this come out with 4.7? Or be an add-on library for 4.7, that will be included in 4.8? Can you define “imminent”? As in later this month, or next?”

It is available as an add-on library for 4.7 now, as part of Qt/3D. See http://doc.qt.nokia.com/qt3d-snapshot/qt3d-building.html for instructions for getting Qt/3D, building, and installing it. We’re looking to mature QML/3D during the remainder of this year to get it ready for some future official Qt release.

We also have a public mailing list for those who wish to help out, ask questions, etc: http://lists.trolltech.com/mailman/listinfo/qt-3d

scorp1us says:

Seriously, it like Qt/Trolls have discovered Nirvana with QML.

Ramunas says:

This demo looks very good!!! :)

Thiago Macieira says:

Great demo, Danny!

qwerty says:

You take lot of difficultiness out of 3d programming and add bunch of happiness to it. wtg +1

ryelluripati says:

Can’t wait to have my hands on QML!

bryanrieger says:

QML has definitely come a long way – very impressive. Love that you were able to sneak in the Kecak chant at the end – http://vimeo.com/8935708 ;)

NuShrike says:

Last I checked, Qt3D was wholly incompatible with Qt4.7.

Rhys Weatherley accepted some of my patchs (thanks!) to help remedy that, but there were texture dependencies on 4.8/master still.

NuShrike: please log any problems you are still having in the Qt bug tracker at http://bugreports.qt.nokia.com/ (Qt3D component).

Note that Qt/3D usually cannot be built with an SDK version of Qt because it relies upon private headers in QtGui and QtOpenGL. Perhaps that is the “incompatibility” you are referring to? I use Qt/3D with 4.7 every day – a 4.7 I built myself from sources – same with 4.8. There is a plan to ship the private headers with the SDK in the future, but it didn’t make it into 4.7.0.

NuShrike says:

R.Weatherley: I take it back, it was QtSceneGraph that’s Qt/master only, not Qt3D, due to QGLTextureGlyphCache dependency issues.

It’s been over a month since I’ve committed a number of patches to Qt/4.7, Qt/master and Qt/3D with only Qt/3D changes merged, so I’m a bit fuzzy now and my time isn’t a generous it was. I was getting frustrated by the glacial pace of patch acceptance though, and no movement on my previous bug reports.

I would still like to see dll/memory usage reduced in line with this QML/3D work. Besides my own projects, there’s current evaluation of QtWebkit going on for … but it’s not going well with how much ram QtWebKit/Core/Gui takes up for embedded. We may just go custom or look at Android instead.

Danny Pope says:

muenalan: “Are the 3d objects already clickable/selectable etc ?”
vpicaver: “I’m interested to see how the trolls are planning on describing 3D interaction with qml.”

Further to Rhys’ response, it’s also worth pointing out that if you have complex models in .3ds files and so on, it is possible to implement QML/3d apps where you can click on individual sub-components of the model as separate sub-items, allowing complex clickable objects.

Danny Pope says:

(by that last comment I mean that clicking different bits of the model can make the app do different things… in case I was unclear)

NuShrike: “I was getting frustrated by the glacial pace of patch acceptance though”

It is usually a good idea to file a bug at the same time as making a merge request. Or drop us a line on the mailing list I mentioned above. The Gitorious system does not reliably send e-mail notifications to project owners about new merge requests, so it is easy for them to become lost. The bug reporting system is better at notifying component owners. Sorry about the delay in processing your Qt/3D merge requests – they went unnoticed due to the lack of notification messages.

kaer says:

regardings new 3D format (Collada, …), I suggest take a look at :
- http://www.opencollada.org/
and http://assimp.sourceforge.net/
theses two library are a good starting point to add 3D import to QT/3D

Mark says:

What’s the current state of play with OpenGL on Symbian with Qt? The examples in the SDK don’t compile (e.g., hellogl_es), and various forum posts suggest OpenGL isn’t yet supported in the SDK for Symbian…?

jstockhausen says:

Great demo! It’s promising to see the featureset of QML grow constantly. Keep on going.

BTW: The monkey is called Suzanne and is part of the Bender project.
http://en.wikipedia.org/wiki/Blender_%28software%29#Suzanne

panzi says:

Very nice!

Is adding a music loop and sounds for the penguins feet hitting the ground also that easy? :)

Danny Pope says:

@bryanrieger: nice to see that the kecak chant is recognised: the movie Ice Age 2 also has an entertaining scene which references the same thing… except with pleistocene era sloths.

@Mark: OpenGL on Symbian is, to some degree, still a work in progress. Devices such as the upcoming N8 will have opengl on symbian working nicely. I’m no expert on other devices, though I’ll look into it.

@jastockhausen: glad to see that the viewers recognise the work of the good people at the Blender foundation – I really should have acknowledged their fine work in the credits – thanks for pointing it out.

@panzi: Actually we’re hoping to do exactly that :)

Commenting closed.