[Interest] Initialization of Buffer entity property in QML

Volker Enderlein volker.enderlein at ifm-chemnitz.de
Wed Apr 10 09:48:19 CEST 2019


Hi,


in a QML file I try to initialize a property of type Buffer, but 
unfortunately it does not work.

There's no error but in the MyMesh Entity the vertices Buffer always has 
zero length.


import Qt3D.Core 2.0
import Qt3D.Render 2.0
import QtQuick 2.0
import Qt3D.Extras 2.10

Entity {
     id: root

     property Buffer vertices: Buffer { type: Buffer.VertexBuffer; data: 
new Float32Array([ -1., 1., 0., 1., 1., 0., -1., -1., 0., 1., -1., 0. ]) }

     MyMesh {

          id: mesh

          vertices: root.vertices

    }

}

How is the correct way?


Cheers, Volker



More information about the Interest mailing list