Using Qt3D today

Qt3D is an amazing library for Qt that gives you the ability to render your own 3D stuff together with your existing widget or QML based GUI. The library was started by the Qt developers a few years back, but has not yet been released with the official Qt SDK. It was announced that it would be bundled with Qt5.0, but because of the state of the library at the time, its release was postponed. Even so, the library is still very mature and appears to work very well in my opinion. So I would urge you to test it out.

Simple install on Ubuntu

To use the library you have a couple of different choices. If you are running Ubuntu, you may just run the following commands:

sudo apt-get install qt3d5-dev qtdeclarative5-qt3d-plugin

And you should be good to go. Look for examples in the Qt3D documentation.

Note that Ubuntu currently doesn’t have QtQuick.Controls available, so you will have to follow the instructions below to combine Qt3D with QtQuick.Controls.

Install Qt3D into the newest Qt release

Currently Qt5.1.1 is the newest stable release of Qt and is the version I’d recommend that you use with Qt3D.

  1. Download and install Qt5.1.1.
  2. Clone Qt3D from Gitorious:
    git clone git://gitorious.org/qt/qt3d.git qt3d
  3. Open QtCreator from your new Qt installation.
  4. Open the qt3d.pro file from the cloned repository and configure it to use the platforms on which you want to use Qt3D (desktop, Android, etc.).
  5. Build for each platform you want to use. Set the build to Release instead of Debug mode while building. You should receive about one hundred warnings if you are building for Android. As always, ignore these.
  6. Open the build folder in a terminal and run
    make install

    This will not install to your system, but to your Qt installation, so that it gets the ability to do awesome 3D stuff.

You should now have Qt3D installed in your Qt installation and be ready to run projects that are using Qt3D.

Published by

Svenn-Arne Dragly

I'm a physicist and programmer, writing about the stuff I figure out as I go.

2 thoughts on “Using Qt3D today”

  1. Can you give more info regarding how you got Qt3D running on Android. I tried building and deploying the cube example but it just complains:
    E/libEGL ( xxxx): called unimplemented OpenGL ES API

    This is on an S4, that happily runs OpenGL ES2 examples from Play Store and lists the adreno libs in the Creator App output pane:
    D/libEGL ( 5769): loaded /vendor/lib/egl/libEGL_adreno.so
    D/libEGL ( 5769): loaded /vendor/lib/egl/libGLESv1_CM_adreno.so
    D/libEGL ( 5769): loaded /vendor/lib/egl/libGLESv2_adreno.so
    I/Adreno-EGL( 5769): : EGL 1.4
    I/Adreno-EGL( 5769): OpenGL ES Shader Compiler Version: 17.01.10.SPL

    Are you using SceneGraph?

Leave a Reply