Daily Archives: 07.01.2015

KDAB on Qt: Overview of Qt3D 2.0 – Part 2

trefoil-wireframe

An Example of Rendering with Qt3D

In the previous article we learned about the requirements and high-level architecture of Qt3D 2.0. In order to put some of this into context and to give you a concrete example of how it looks to draw something in Qt3D using the QML API, we will now briefly show the important parts of one of the simple examples that will ship with Qt3D. We will start off simple and just draw a single entity (a trefoil knot) but to make it slightly more interesting we will use a custom set of shaders to implement a single-pass wireframe rendering method. This is what we will draw:

As mentioned in the previous article, the renderer aspect looks for entities that have some geometry, a material and optionally a transformation. These are all specified in the form of subclasses of QComponent which have been exported to the QML engine in the form of Mesh, Material and Transform respectively. So let’s use these components to make a custom QML item in TrefoilKnot.qml

import Qt3D 2.0
import Qt3D.Render 2.0

Entity {
    id: root

    property alias x: translation.dx
    property alias y: translation.dy
    property alias z: translation.dz
    property alias scale: scaleTransform.scale
    property alias theta: thetaRotation.angle
    property alias phi: phiRotation.angle
    property Material material

    components: [ transform, mesh, root.material ]

    Transform {
        id: transform
        Translate { id: translation }
        Scale { id: scaleTransform }
        Rotate{ id: thetaRotation; axis: Qt.vector3d( 1.0, 0.0, 0.0 ) }
        Rotate{ id: phiRotation;   axis: Qt.vector3d( 0.0, 1.0, 0.0 ) }
    }

    Mesh {
        id: mesh
        source: ":/assets/obj/trefoil.obj"
    }
}

Let’s break this down to see what’s going on here. We start off by importing the Qt3D 2.0 module that provides the Entity type and value type helpers like Qt.vector3d(). We also import the Qt3D.Render 2.0 module …read more

Source:: http://www.kdab.com/overview-qt3d-2-0-part-2/

      

KDAB on Qt: Overview of Qt3D 2.0 – Part 2

trefoil-wireframe

An Example of Rendering with Qt3D

In the previous article we learned about the requirements and high-level architecture of Qt3D 2.0. In order to put some of this into context and to give you a concrete example of how it looks to draw something in Qt3D using the QML API, we will now briefly show the important parts of one of the simple examples that will ship with Qt3D. We will start off simple and just draw a single entity (a trefoil knot) but to make it slightly more interesting we will use a custom set of shaders to implement a single-pass wireframe rendering method. This is what we will draw:

As mentioned in the previous article, the renderer aspect looks for entities that have some geometry, a material and optionally a transformation. These are all specified in the form of subclasses of QComponent which have been exported to the QML engine in the form of Mesh, Material and Transform respectively. So let’s use these components to make a custom QML item in TrefoilKnot.qml

import Qt3D 2.0
import Qt3D.Render 2.0

Entity {
    id: root

    property alias x: translation.dx
    property alias y: translation.dy
    property alias z: translation.dz
    property alias scale: scaleTransform.scale
    property alias theta: thetaRotation.angle
    property alias phi: phiRotation.angle
    property Material material

    components: [ transform, mesh, root.material ]

    Transform {
        id: transform
        Translate { id: translation }
        Scale { id: scaleTransform }
        Rotate{ id: thetaRotation; axis: Qt.vector3d( 1.0, 0.0, 0.0 ) }
        Rotate{ id: phiRotation;   axis: Qt.vector3d( 0.0, 1.0, 0.0 ) }
    }

    Mesh {
        id: mesh
        source: ":/assets/obj/trefoil.obj"
    }
}

Let’s break this down to see what’s going on here. We start off by importing the Qt3D 2.0 module that provides the Entity type and value type helpers like Qt.vector3d(). We also import the Qt3D.Render 2.0 module …read more

Source:: http://www.kdab.com/overview-qt3d-2-0-part-2/

      

KDAB on Qt: Overview of Qt3D 2.0 – Part 2

trefoil-wireframe

An Example of Rendering with Qt3D

In the previous article we learned about the requirements and high-level architecture of Qt3D 2.0. In order to put some of this into context and to give you a concrete example of how it looks to draw something in Qt3D using the QML API, we will now briefly show the important parts of one of the simple examples that will ship with Qt3D. We will start off simple and just draw a single entity (a trefoil knot) but to make it slightly more interesting we will use a custom set of shaders to implement a single-pass wireframe rendering method. This is what we will draw:

As mentioned in the previous article, the renderer aspect looks for entities that have some geometry, a material and optionally a transformation. These are all specified in the form of subclasses of QComponent which have been exported to the QML engine in the form of Mesh, Material and Transform respectively. So let’s use these components to make a custom QML item in TrefoilKnot.qml

import Qt3D 2.0
import Qt3D.Render 2.0

Entity {
    id: root

    property alias x: translation.dx
    property alias y: translation.dy
    property alias z: translation.dz
    property alias scale: scaleTransform.scale
    property alias theta: thetaRotation.angle
    property alias phi: phiRotation.angle
    property Material material

    components: [ transform, mesh, root.material ]

    Transform {
        id: transform
        Translate { id: translation }
        Scale { id: scaleTransform }
        Rotate{ id: thetaRotation; axis: Qt.vector3d( 1.0, 0.0, 0.0 ) }
        Rotate{ id: phiRotation;   axis: Qt.vector3d( 0.0, 1.0, 0.0 ) }
    }

    Mesh {
        id: mesh
        source: ":/assets/obj/trefoil.obj"
    }
}

Let’s break this down to see what’s going on here. We start off by importing the Qt3D 2.0 module that provides the Entity type and value type helpers like Qt.vector3d(). We also import the Qt3D.Render 2.0 module …read more

Source:: http://www.kdab.com/overview-qt3d-2-0-part-2/

      

You Could Hang These Giant Family-Friendly Tablets on Your Walls

By Jamie Condliffe

You Could Hang These Giant Family-Friendly Tablets on Your Walls

Is your home lacking a giant interactive slab of glass for you children to leave giant paw prints all over? Then the latest additions to Fuhu’s Big Tab range, including 42-inch, 55-inch and 65-inch versions of its gigantic family-oriented tablet range, could be just the thing.

…read more

Source:: http://feeds.gawker.com/~r/gizmodo/full/~3/pDooNV-W28s/you-could-hang-these-giant-family-friendly-tablets-on-y-1677933764

      

Stardust Is The Best Fantasy Movie You’ve Never Seen

By Nicholas Stango

Put simply, Stardust is the best movie no one has seen. It managed to slip under a bunch of people’s noses, most likely because of its name (it does sound pretty cheesy). Fortunately for you, that means this little treasure is something you can discover now. I hope you like fantasy.

…read more

Source:: http://feeds.gawker.com/~r/gizmodo/full/~3/e1FNkUb6rAA/stardust-is-the-best-fantasy-movie-youve-never-seen-1677815631

      

What Whitney Houston Would’ve Sounded Like As a Disco Queen

By Adam Clark Estes

What Whitney Houston Would've Sounded Like As a Disco Queen

Oliver Nelson is a Swedish electronic music producer with a decidedly disco touch. Whitney Houston was an American singer with a decidedly golden touch. What happens when you combine the two? Magical things, I tell you.

…read more

Source:: http://feeds.gawker.com/~r/gizmodo/full/~3/bbctCUBBH1w/what-whitney-houston-wouldve-sounded-like-as-a-disco-qu-1672675239