Approach for reusing a mesh

I need to draw a lot of circles (whose initial size is set dynamically) on the screen and move them around. At any one time, some of the circles may not be moving.

Right now, I just draw each circle in my draw method, but its seems like I could somehow just reuse / copy a single circle, and then only redraw the ones which moved.

Looking at the docs, it looks like I could draw the circles to a ofVboMesh, and then just update the vertices for each circle when it moves.

Is that the best approach? Is there an easier way to move the circles (and not have to do it vertex by vertex)?

Basically, I could just use a nudge in the direction of what the right approach is (with an eye to performance).

Hi! Have you looked at the vboMesh example?


Sounds like it could help you. Also, using instanced mode you can probably draw tens of thousands of items, but maybe that’s more than what you need? There’s two examples of “instanced” inside examples/gl/.

Thank you! I was looking for something just like that.