i use this little template.

draw()
  set 3d()
  draw 3d
  set 2d()
    push projection matrix
    setup ortho projection
    push modelview matrix
  draw 2d
  unset 2d()
    pop modelview matrix
    pop projection matrix


        def on_draw(self):

                self.set3d()
                # draw 3D

                self.set2d()
                # draw 2D
                self.unSet2d()

        def set3d(self):
                # your usual 3D setup/update

        def set2d(self):

                glMatrixMode(GL_PROJECTION)
                glPushMatrix()
                glLoadIdentity()

                glOrtho( float(self.oL), float(self.oR), float(self.oB),
float(self.oT), -1.0, 1.0 )

                glMatrixMode(GL_MODELVIEW)
                glPushMatrix()
                glLoadIdentity()

        def unSet2d(self):

                glMatrixMode(GL_MODELVIEW)
                glPopMatrix()
                glMatrixMode(GL_PROJECTION)
                glPopMatrix()

-- 
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.

Reply via email to