On Oct 7, 2:59 am, Alejandro Castellanos <[email protected]> wrote: > Ben, I just checked your zsprite in the example that you posted the > link to, and was came away very interested, and not to be the slow one > here, but how exactly does it work?
Basically OpenGL is a 3D system. In 2D mode you normally just use 2 of the coordinates, X and Y, to plot your graphics. But there is a 3rd coordinate Z which is the axis going into or coming out of the screen. All I've done is give certain sprites smaller values of Z to make them effectively further away, and the OpenGL depth buffer does the hard work of remembering what Z values a previous sprite used and deciding which parts of new sprites can be drawn based on that. I picked the values of Z based on the row the tile was in, but you'd have to decide how to do this for your own app. (However, see Brian Fisher's note about alpha - anything with partial alpha values still need to be rendered back to front for correct results. If you have a lot of blending then this system may not help you.) -- Ben Sizer --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
