I'm looking for a basic example of how to set up an Entity with a GeometryRenderer in QML.
The code I'm using right now is shown below. If I replace geometryRenderer by a CuboidMesh then a blank cube is shown. The goal is to display a simple triangle. Is my GeometryRenderer declaration correct ?
Entity{
Material{
id: simpleMaterial
effect: SimpleEffect{}
}
GeometryRenderer{
id: geometryRenderer
instanceCount: 1
primitiveType: GeometryRenderer.Triangles
geometry: Geometry{
Attribute{
attributeType: Attribute.VertexAttribute
vertexBaseType: Attribute.Float
vertexSize: 3
byteOffset: 0
byteStride: 3 * 4
count: 3
buffer : Buffer{
id: vertexBuffer
type: Buffer.VertexBuffer
data: [ 0.0, 0.0, 0.0,
0.0, 10.0, 0.0,
10.0, 10.0, 0.0]
}
}
}
}
components: [simpleMaterial, geometryRenderer]
}