On Thu, Oct 9, 2008 at 11:04 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> ...
> There must be simple gl command I can put somewhere to flip the co-
> ordinates, right? I can hardly be the first person to run up against
> this...

Here's what I do:

    # Set default projection to use upper left as origin
    pyglet.gl.glMatrixMode(pyglet.gl.GL_PROJECTION)
    pyglet.gl.glLoadIdentity()
    pyglet.gl.glOrtho(0.0, 1024.0, 768.0, 0.0, -1.0, 1.0)
    pyglet.gl.glMatrixMode(pyglet.gl.GL_MODELVIEW)
    pyglet.gl.glLoadIdentity()

This makes 0,0 the upper left corner of the screen and 1024, 768 the
bottom right corner.  But if you're thinking that this is what you
want, you should consider what will happen!  If you use any function
that is not expecting this, it will draw upside down.  For example,
try drawing some text using:

label = pyglet.text.Label('Hello, world',
                          font_name='Times New Roman',
                          font_size=36,
                          x=window.width//2, y=window.height//2,
                          anchor_x='center', anchor_y='center')
label.draw()

It will come out beautifully rendered in the right location, but
reflected upside down.
--
Nathan Whitehead

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