On Tue, Dec 15, 2009 at 10:46 AM, Tristam MacDonald <[email protected]>wrote:
> On Tue, Dec 15, 2009 at 7:59 AM, Corbin <[email protected]> wrote: > >> I'm not exactly sure why using matrices is a bad thing. I'm mostly just >> annoyed that I have >> to do all this matrix math myself instead of just handing off a couple >> of potentially pre-created matrices; AFAICT pyglet doesn't have any >> utility methods for matrix math. >> > > Sprites are inherently 2-dimensional. Using 4x4 matrices to transform them > would be a gross waste of processing power ;) > > Above and beyond that, your suggestion of using the matrix stack would > require you to set the modelview matrix for *each* sprite. Instead, pyglet > manually calculates the sprite transform, so that it can pack many sprites > into a single vertex buffer, and render them with a single draw call. > > This is essential for OpenGL performance, and even more so for pyglet - the > ctypes bindings make individual OpenGL calls very expensive. > I see how the pyglet way can be faster when there are a lot of static sprites. When the sprites are mostly rotating - moving, theris no penalty in the pyglet way (vs the old matrix stack) ? -- claxo -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
