Thank you Casey, The thing is I don't know how to go back to the 2D state (default). PushMatrix and PopMatrix don't seem to work for some reason, I will try to isolate the problem and post the code later, but in any case I don't know how to go back to whatever state is the default, as in simple-menu-class (link above) that simply specifies no projection, and I don't know how to save the current data any other way than PushMatrix and PopMatrix.
Thanks for the pointers. On Jan 27, 9:20 pm, Casey Duncan <[email protected]> wrote: > On Tue, Jan 27, 2009 at 10:58 AM, nachik <[email protected]> wrote: > > > I'm trying to incorporate simple-menu-class ( > >http://groups.google.com/group/pyglet-users/web/simple-menu-class) > > into a small 3D test and I don't see anything, just so I can switch > > from keyboard control to a more visual control (actually I'd leave > > both). > > > I thought then glPopMatrix every time I draw the menu > > would be enough but apparently it isn't. > > If I understand correctly, you are trying to switch from 3D > perspective to a 2D ortho projection to draw the menu, correct? > > If that's the case, glPushMatrix/glPopMatrix is sufficient to save the > projection if the current matrix mode is GL_PROJECTION afaik. Note > however that the stack depth for GL_PROJECTION is typically very > shallow (like around 2), so you cannot nest these pushes and pops > without getting an error. > > I don't typically bother with saving and restoring the projection > state this way, instead I just encapsulate the state change code > somewhere (like a pyglet Group or a game state object) for 2D and 3D > parts and make sure it gets invoked before the specific elements are > drawn. Taking care not to do the state changes more than necessary, > which a Group object helps with. > > hth, > > -Casey --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
