Hi, that would be probably the best. But to be honest i still have some unexpected resoults when i mix batch_groups and z-depth. On the other hand if users will go with the basic -1,1 range of depth they have to remeber to set subpixel=true for each sprite at the creation stage. Unfortunately it looks that it is quite tricky to use it right now
Pt., 5.04.2019, 08:05 użytkownik Benjamin Moran <[email protected]> napisał: > Hi Marcin, > > This is mostly because of how z coordinates are handled in OpenGL being > opposite from what you might expect. > At the moment, I don't plan to merge this in (because of the blending > hurdles mentioned earlier in this thread). > > Maybe we could leave the ZSprite class in the examples folder in the > repository? That way it's available for those > who want it, and understand the tradeoffs. > > > On Sunday, March 31, 2019 at 7:36:03 AM UTC+9, Marcin wrote: >> >> *when i have used the standard version it was opposite >> >> W dniu sobota, 30 marca 2019 23:35:05 UTC+1 użytkownik Marcin napisał: >>> >>> Good Afternoon, >>> >>> When i use the "new" sprite.py the Z ordering works nice. >>> >>> One change that i have noticed is that batch groups are drawn from >>> bigger number to lower (when i have used . Do you plan to keep this that >>> whey in the future versions? >>> >>> [image: Przechwytywanie.PNG] >>> >>> >>> >>> W dniu środa, 6 lutego 2019 02:46:19 UTC+1 użytkownik Benjamin Moran >>> napisał: >>>> >>>> Sorry for the very late reply. I just realized I never got back to >>>> this. >>>> In case you're still interested, the line you're looking for is: >>>> >>>> gl.glOrtho(0, max(1, width), 0, max(1, height), -1, 1) >>>> >>>> At the end, the -1, 1 is responding to the z depth. You can change >>>> these values to something higher, like 255. >>>> >>>> >>>> On Saturday, December 8, 2018 at 9:46:29 PM UTC+9, Darth Dan wrote: >>>>> >>>>> Yeah, looks about right when I divide my Z with a large enough number. >>>>> Except that it also seems to be functioning in reverse, but that's >>>>> easy to fix. >>>>> >>>>> def on_resize(self, width, height): >>>>> """A default resize event handler. >>>>> >>>>> This default handler updates the GL viewport to cover the >>>>> entire >>>>> window and sets the ``GL_PROJECTION`` matrix to be orthogonal >>>>> in >>>>> window space. The bottom-left corner is (0, 0) and the >>>>> top-right >>>>> corner is the width and height of the window in pixels. >>>>> >>>>> Override this event handler with your own to create another >>>>> projection, for example in perspective. >>>>> """ >>>>> viewport = self.get_viewport_size() >>>>> gl.glViewport(0, 0, max(1, viewport[0]), max(1, viewport[1])) >>>>> gl.glMatrixMode(gl.GL_PROJECTION) >>>>> gl.glLoadIdentity() >>>>> gl.glOrtho(0, max(1, width), 0, max(1, height), -1, 1) >>>>> gl.glMatrixMode(gl.GL_MODELVIEW) >>>>> >>>>> Unfortunately this gives me very little info as I never worked with >>>>> OpenGL before in my life let's see if I can finc anything on it in the >>>>> internet though. window._init_.draw() method only has X and Y coordinates >>>>> as args, is that correct? >>>>> >>>> -- > 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 https://groups.google.com/group/pyglet-users. > For more options, visit https://groups.google.com/d/optout. > -- 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 https://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.
