2009/10/5 scav <[email protected]> > > I am changing a simple graphics library from pygame and PyOpenGL to > use pyglet instead. > > This library has a container object that renders its contents in a > perspective projection, and I want to render that container in my > on_draw() handler. But I don't want to disrupt the default > orthographic projection - I want to be be able to render text and > other 2D stuff on that as usual, then draw the 3D objects "behind > it". > > What do I need to do in my on_draw() to make sure that I don't stuff > everything up and get a black screen? > > Note: I've tried pushing and popping the projection and modelview > matrices around my 3D drawing, but whatever I've tried so far, my > ClockDisplay() disappears after one frame, suggesting something has > gone badly wrong. > > I'll keep trying things, but does anyone have a suggestion? Even if > it's "don't do it that way". >
I would have thought you need to 1. pop the projection matrix 2. set up your 3d projection 3. switch to the modelview matrix 4. draw all your 3d stuff 5. push the original projection back 6. back to the modelview matrix and draw the 2d stuff. If that doesn't work, post your code. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
