This is an example of a custom geometry written as an answer on this stackoverflow question. It shows how to use ColorSemantic
attribute to create a vertex buffer with per vertex color. It is a stripped down version of the Qt Quick 3D - Custom Geometry Example.