Hi, Thanks for the response.
This is what I can't seem to get my head around ... how does the window know what area to draw ? If I pass it the x and y value, does it draw x + window width and y + window width, so by incrementing, decremeting x and y it actually moves the 'view' or 'camera' around ? Thanks -Mic 2008/12/11 Alex Holkner <[email protected]>: > > On 12/12/08, Mic Pringle <[email protected]> wrote: >> >> Hi, >> >> I'm new to Pyglet and OpenGL and have an issue that I can't seem to >> get my head round. What I'd like to do, as an example, is say create a >> window 320 x 240 window and then load an image 512 x 512 into it. >> Obviously this is too large to display in the window so I'd like to be >> able to move the 'view' of the window round to be able to see >> different parts of the image, using the keyboard. I don't want to move >> the image itself, but rather the 'view' (or camera if you like) of >> what is being drawn. >> >> 512 x 512 image >> >> ----------------------------------- >> | | >> | area drawn by window >> | -------------------- | >> | | | | >> | | | | >> | | | | >> | -------------------- | >> ---------------------------------- >> >> Sorry for the crude illustration ! >> >> Can anyone point me in the right direction of how this could be best >> implemented. I gave the image scenario as an example, as I want to >> use this for drawing the gameworld in my game which is why I want the >> 'view' area to move rather than the image. >> >> I hope all this makes sense. > > Use glTranslatef before your drawing code, e.g.: > > > from pyglet.gl import * > > def on_draw(): > glLoadIdentity() > glTranslatef(-view_x, -view_y, 0) > # draw scene here > > > Alex. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
