[Interest] Has some examples about new version qt3d (5.5 or later) to operate 3d model mesh and sub mesh?

Sean Harmer sh at theharmers.co.uk
Wed Feb 24 20:25:09 CET 2016


Hi Jordan,

On 24/02/2016 02:27, Jordon Wu wrote:
> Hi Sean,
>
> This is a cool 3d demo(https://www.youtube.com/watch?v=zCBESbHSR1k)!
>
> Is this demo using assimp to load 3d model or using gltf to load 3d 
> model ?

Nope, each sub mesh is in it's own OBJ file which we load using the Mesh 
component. So in essence what we have is a scene graph hierarchy of 
RenderEntity's which look something like this:

Entity {
     id: root

     property alias translation: transform.translation
     property real scale: transform.scale
     property Mesh mesh
     property Material material
     property Layer layer

     Transform {
         id: transform
         translation: Qt.vector3d(x, y, z)
     }

     components: [
         mesh,
         material,
         transform,
         layer
     ]
}

And then when we instantiate them they look like:

// LEFT DOOR
     RenderEntity {
         mesh: leftDoor
         material: materials.doorPaint
         layer: carLayer
         y: 0.5 * root.explodeProgress
         x: 1 * root.explodeProgress

         RenderEntity {
             mesh: leftDoorGlass
             material: materials.window
             layer: carLayer
         }

         RenderEntity {
             mesh: leftDoorHinge
             material: materials.darkPlastic
             layer: carLayer
         }
         RenderEntity {
             mesh: leftDoorMirror
             material: materials.trim
             layer: carLayer
         }

         RenderEntity {
             mesh: leftDoorOpener
             material: materials.aluminium
             layer: carLayer
         }

         RenderEntity {
             mesh: leftDoorInnerLower
             material: materials.salonDevicesPlate
             layer: carLayer
         }

         RenderEntity {
             mesh: leftDoorInnerUpper
             material: materials.salonMaterial
             layer: carLayer
         }
     }

where for e.g. mesh: leftDoor just refers to a Mesh property elsewhere 
in the scope.

>
> BTW, Are you open this demo source code to public? Thanks

I can't publish it just yet as we can't distribute the model itself so I 
need to strip that out. Hopefully soon though.

Sean

>
> Best Regards
> Jordon Wu
>
> 2016-02-23 15:58 GMT+08:00 Sean Harmer <sh at theharmers.co.uk 
> <mailto:sh at theharmers.co.uk>>:
>
>     Hi,
>
>     On 23/02/2016 07:04, Jordon Wu wrote:
>>     Hi list all,
>>
>>     I'm begin study qt3d(qt5.5 version) now. And I want to found some
>>     examples about 3d model mesh and sub mesh operation.
>>
>>     I google found a good example QtQuick3D Tutorial - Car3D (
>>     http://www.youtube.com/watch?v=VvQ_NHKtHwE ), but this qt3d is
>>     V1.0  and the example did not run on qt3d 5.5 or later.
>>
>>     Has anyone know where could found example about qt3d to operate
>>     3d model mesh and sub mesh like above Car3D examples ? Thanks
>
>     Well, in making of this car demo,
>     https://www.youtube.com/watch?v=zCBESbHSR1k we simply exported the
>     submeshes we needed explicit control over as separate obj files
>     and loaded each one usign a Mesh component aggregated to an
>     Entity. Each Entity has it's own Transform component that we then
>     bind properties to QML expressions that reference the Qt Quick
>     Controls, e.g. slider values or boolean switches.
>
>     You can also have all meshes in a single OBJ file and reference
>     the sub mesh you wish to render in the Mesh component. We tried
>     this but found it to be better to split them out as it allows more
>     work to be done in parallel at start up, leading to faster startup
>     times.
>
>     Cheers,
>
>     Sean
>
>>
>>
>>     Best Regards
>>
>>     Jordon Wu
>>
>>
>>
>>     _______________________________________________
>>     Interest mailing list
>>     Interest at qt-project.org <mailto:Interest at qt-project.org>
>>     http://lists.qt-project.org/mailman/listinfo/interest
>
>
>     _______________________________________________
>     Interest mailing list
>     Interest at qt-project.org <mailto:Interest at qt-project.org>
>     http://lists.qt-project.org/mailman/listinfo/interest
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160224/8f49c232/attachment.html>


More information about the Interest mailing list