pyglet-users  

Re: Image rotation

[EMAIL PROTECTED]
Sun, 10 Feb 2008 22:04:35 -0800

Oh, you can just use projection matrix commands? COOL! I totally
didn't realize that! Now everything is perfect.

On Feb 10, 3:28 pm, "Txema Vicente" <[EMAIL PROTECTED]> wrote:
> > you a start. Try nehe.gamedev.net for some tutorials.
>
> Try  http://groups.google.com/group/pyglet-users/web/nehe-lessons-1-10
>
> > On Feb 9, 5:07 pm, cladinapathy <[EMAIL PROTECTED]> wrote:
> >> Does pyglet support image rotation? If so, how? Thanks in advance.
>
> Some ugly test code may help you:
>
> from pyglet import window,image
> from pyglet.gl import *
>
> def gl_blit(image,x=0,y=0,rz=0,s=1):
>     w,h=image.width/2.,image.height/2.
>     glPushMatrix()
>     glTranslatef(x+w,y+h,0)
>     glRotatef(rz,0,0,1)
>     glScalef(s,s,1)
>     img.blit(-w,-h,0)
>     glPopMatrix()
>
> win = window.Window()
> img=image.load("test.png")
> r=0
> while not win.has_exit:
>     win.dispatch_events()
>     r+=1
>     gl_blit(img,300,200,r)
>     win.flip()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to pyglet-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---