title: Qt3D - Instance rendering of 2 squares. PrimitiveType? InstanceCount?
body: <p>I'd like to display on the screen 2 squares using instance rendering.<br/><br/>
  The problem is :<br/>
  When I draw 2 squares, they are connected. I can't draw multiple separate square. <br/><br/>
  I know it has to do with PrimitiveType : i'm using <em>Qt3DRender::QGeometryRenderer::LineLoop</em> or <em>Qt3DRender::QGeometryRenderer::TriangleFan</em> but is there a way to tell Qt to separate my data buffer in multiple instances ? so that the PrimitiveType apply on each instances and not all the vertices.</p>
  <p>I got a function that create shapes :</p>
  <pre><code>Qt3DCore::QEntity* SceneBuilder::createShapeInstancing(const QList&lt;QVector3D&gt; &amp; listVertices, int nbPointGeometry, const QColor color, Qt3DCore::QEntity * rootEntity) 
  {
      // Material
      Qt3DExtras::QPhongMaterial *material = new Qt3DExtras::QPhongMaterial(rootEntity);
      material-&gt;setAmbient(color);
  
      // Custom entity
      Qt3DCore::QEntity *customMeshEntity = new Qt3DCore::QEntity(rootEntity);
  
      // Custom Mesh
      Qt3DRender::QGeometryRenderer *customMeshRenderer = new Qt3DRender::QGeometryRenderer(rootEntity);
      Qt3DRender::QGeometry *customGeometry = new Qt3DRender::QGeometry(customMeshRenderer);
  
      Qt3DRender::QBuffer *vertexDataBuffer = new Qt3DRender::QBuffer(Qt3DRender::QBuffer::VertexBuffer, customGeometry);
  
      int nbPointGeometry = nbPoint;
  
      QByteArray vertexBufferData;
      vertexBufferData.resize(listVertices.size() * nbPointGeometry * sizeof(QVector3D));
      QVector3D *posData = reinterpret_cast&lt;QVector3D *&gt;(vertexBufferData.data());
  
      QList&lt;QVector3D&gt;::const_iterator it;
      for (it = listVertices.begin(); it != listVertices.end(); it++)
      {
          *posData = *it;
          ++posData;
      }
  
      vertexDataBuffer-&gt;setData(vertexBufferData);
  
      //Attributes
  
      Qt3DRender::QAttribute *positionAttribute = new Qt3DRender::QAttribute();
      positionAttribute-&gt;setName(Qt3DRender::QAttribute::defaultPositionAttributeName());
      positionAttribute-&gt;setAttributeType(Qt3DRender::QAttribute::VertexAttribute);
      positionAttribute-&gt;setBuffer(vertexDataBuffer);
      positionAttribute-&gt;setVertexBaseType(Qt3DRender::QAttribute::Float);
      positionAttribute-&gt;setVertexSize(3);
      positionAttribute-&gt;setByteOffset(0);
      positionAttribute-&gt;setByteStride((0 + 3) * sizeof(float));
      positionAttribute-&gt;setCount(listVertices.size());
      //positionAttribute-&gt;setDivisor(1);
  
      customGeometry-&gt;addAttribute(positionAttribute);
  
      customMeshRenderer-&gt;setGeometry(customGeometry);
      //customMeshRenderer-&gt;setInstanceCount(listVertices.size()/nbPoint);
      if (nbPointGeometry == 1)
          customMeshRenderer-&gt;setPrimitiveType(Qt3DRender::QGeometryRenderer::Points);
      else if (nbPointGeometry == 2)
          customMeshRenderer-&gt;setPrimitiveType(Qt3DRender::QGeometryRenderer::Lines);
      else if (nbPointGeometry == 3)
          customMeshRenderer-&gt;setPrimitiveType(Qt3DRender::QGeometryRenderer::Triangles);
      else
          customMeshRenderer-&gt;setPrimitiveType(Qt3DRender::QGeometryRenderer::LineLoop);
  
      customMeshEntity-&gt;addComponent(customMeshRenderer);
      customMeshEntity-&gt;addComponent(material);
  
      return customMeshEntity;
  }
  </code></pre>
  <p>When i call this function, i put my 2 squares inside the listVertices variables. So that all my squares are display in one draw call. <br/></p>
  <p>But the shapes are one way or another connected. Is there a way to remove that ? I'm not using <strong>InstanceCount</strong> or <strong>Divisor</strong> but i don't know how it works. I made some tests with it but nothing worked</p>