Is there a way to take an existing mesh and add and remove vertices whenever I want of do I have to just start over

This would be so convenient because I am going to be using a scene that is changing in relation to itself, but who’s isn’t .

1 Like

It kind of depends a bit on your mesh and how you want to modify it. You can add and remove vertices from the mesh, but if you have indices (a draw order), colors, normals, etc that are associated with that vertex, then those will need to be modified as well. You can .addVertex() and .removeVertex() to add or remove a vertex from a mesh. There are some other vertex-modifying functions in the class, so have a look at the documentation.

In some cases, you may want to add or delete whole triangles from the mesh, not just vertices. You can use the .getUniqueFaces() function for an ofMesh to get a vector of individual triangles (ofMeshFace objects). After you’ve added, deleted, or modified the ofMeshFace, you can update the ofMesh with the .setFromTriangles() function.

If I remember right, the 3dPrimitives example uses some of these features of ofMesh.