Currently I can draw a polygon using the Handle_Graphics3d_Group->Polygon like so:
Graphic3d_Array1OfVertex topVertices(0, points.size() - 1);
/* populate vertices from points*/
group->Polygon(topVertices, Graphic3d_TypeOfPolygon::Graphic3d_TOP_UNKNOWN, true);
However, on redrawing I get a read memory access error violation, which I think has to do with the topVertices not being a 'Handle' type. I can draw the polygons as primitives:
/* Populate Polygons */
But the shading and presentation do not look the same/as good as using the Polygon function. Does any have any ideas on how I can call the Group->Polygon function in a way that avoids the memory access error? I am drawing between 500 - 2000 of these polygons in 3D, and they will be aligned with a 3D plane (i.e. no curvature to the polygon surface). Or, if there is a way to remove shading/lines/create a solid coloured polygon using the second method, that would be great as well.
Any help is appreciated.