So right now I have 5000 instances of a class ‘Word’ that in its draw function contains the method font.drawString from ofTrueTypeFont class. I have seen some people using ofVboMesh. For instance @arturo suggested this way:
translating a mesh is just adding the translation to each vertex so you can do that before appending it to the total mesh. for the colors you can use colored vertices and add the color with which you want to draw each text to each of it’s vertices, somehting like:
for every word
for every vertex in word.mesh
vertex = vertex + position
color = word color
to avoid making a copy of all the vertices and also if you are going to use the same words all the time you could create a cache of words meshes, for example on a map<string,ofMesh>, to not have to recreate them every frame
That looks very promising! I have done a quick test and seems very fast although Im getting everything flipped vertically. Yes definitely the “map” makes sense, however, if I want to constantly change the color of each word independently would make still sense to use map? How about if I want that each word has a different size?