I have an entity formed of multiple triangles (custom mesh called bigEntity).
I want to create an entity (a triangle called littleEntity) with the exact same position of an existing triangle of the bigEntity but with a different color.
The probleme here is that the littleEntity is created but doesn't appear on screen. I create this littleEntity after the bigEntity. It should appear on screen no? Is there a way to do it ?
I know there is this, but i don't want to touch framegraph, and i'm not sure that it would be sufficient.
Here a simplified code of the issue :
QList<QPair<int, QVector3D>> listVertices;
listVertices.append(qMakePair(1, QVector3D(-2,2,0)));
listVertices.append(qMakePair(1, QVector3D(-1, 2, 0)));
listVertices.append(qMakePair(1, QVector3D(-1, 0, 0)));
listVertices.append(qMakePair(1, QVector3D(-2, 2, 0)));
listVertices.append(qMakePair(1, QVector3D(-1, 0, 0)));
listVertices.append(qMakePair(1, QVector3D(-2, 0, 0)));
Qt3DCore::QEntity * bigEntity = this->m_sceneBuilder->createInstancedShape(listVertices, 3, Qt::yellow, this->m_rootEntity);
listVertices.clear();
listVertices.append(qMakePair(1, QVector3D(-2, 2, 0)));
listVertices.append(qMakePair(1, QVector3D(-1, 2, 0)));
listVertices.append(qMakePair(1, QVector3D(-1, 0, 0)));
Qt3DCore::QEntity * littleEntity = this->m_sceneBuilder->createShape(listVertices, Qt::blue, this->m_rootEntity);
//if i add tranform, i can see the littleEntity
/*Qt3DCore::QTransform *transform = new Qt3DCore::QTransform();
transform->setTranslation(QVector3D(0.1, 0.1, 0.1));
littleEntity->addComponent(transform);*/
Knowing that createShape and createInstancedShape just create custom mesh using QGeometryRenderer and QGeometry and return the QEntity created.
When i draw littleEntity before bigEntity it work, but in my program i can't do that ..