oh, sorry - my projection is

glViewport(0, 0, window.width, window.height)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()

glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)

(oh hello community! first post :)

- James


On Jun 6, 2008, at 1:48 PM, jamesr wrote:

> I had this problem too, and I solved it this way:
>
> (presuming that X is an object that has x, y, w, h)
>
> x, y, w, h = X.x, screenHeight-X.y, X.w, -X.h
>
> and then this code to draw those GL objects:
>
> glRasterPos2d(x, y)
> glColor4f(br, bg, bb, a)
> glBegin(GL_QUADS)
> glVertex2f(x, y)
> glVertex2f(x+w, y)
> glVertex2f(x+w, y+h)
> glVertex2f(x, y+h)
> glEnd()
>
> then for all images i used (where X is again an object with x y w h,  
> this time for a picture)
>
> img.blit(x, 0-(X.height-y))
>
> This works (mostly) for me! Comments? Better ways? let me know..
>
>
> On Jun 5, 2008, at 8:16 PM, sunetos wrote:
>
>>
>> Hey, I'm new to pyglet, and it seems great so far.  One thing that
>> keeps biting me is that the data I need to work with, needs the  
>> origin
>> at the top-left corner of the screen.  Simply setting glOrtho() and
>> glViewport() before the render isn't sufficient, because then I just
>> get a render that's reflected vertically.  Right now it's looking  
>> like
>> I'll have to subclass just about every class in pyglet to account for
>> a negative Y offset to get what I need.  Is there a better way?
>> >>
>


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