I agree that "don't fix it if it ain't broke". But, even without the transforms, having one big batch would be faster than 1000's of individual draws (is my understanding). Then, if you are transforming 1000's of individual shapes every time you draw, I imagine that would be much slower than a batch. Moving shapes will need to be transformed every draw, but not static ones.
I would keep a list of static objects and a separate list of dynamic ones. Each object keeps track of its center and the position of its vertices in relation to the center. When a static shape changes, and every frame for the dynamic ones, iterate through all the shapes and have them append their transformed vertices to a master list. If no shapes were added or removed since last time, update the vertices directly (vertexlist.vertices = newvertices). If a shape was added or removed, delete the old vertexlist and add a new one (you'll have to add color/texture vertices too). With batches you need to include degenerate vertices so the shapes aren't all connected together. With triangle strips you prepend the first vertex again and append the last, so the first one repeats at the beginning and the last one repeats at the end. I don't know if individual draws are different in that respect. I don't know of any transformation helper functions. Since in this case the rotation will happen around (0,0), followed by a translation, you can write something that is quicker than a general purpose transformation. -Elliot On Sunday, May 5, 2013 11:14:19 PM UTC-5, Nathan wrote: > > Not sure how helpful this will be, but I think you deserve at least _some_ > response. > > First, No idea. Measure your frame rate. If it's >= what you want, then > why worry about it? > > Second: No idea. I bet you'd get the answer real quick if you just wrote > a quick 'n dirty demo to try it out, though. > > Third: Don't know. > > Fourth: From what I've seen on this list, everyone is talking about vertex > buffer objects and stuff like that, and saying the old straightforward > OpenGL ways are slow now. > > ~ Nathan > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pyglet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
