[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Anyone use Blender to create sprite sequences?
On Sat, 25 Sep 2004, Simon Wittber wrote:
> Jasper Wrote:
> > On the other hand, perhaps it's a big win when rendering through openGL?
> > I can see how if you put the filmstrip into texture memory their _might_
> > be a way to change the drawn subrect, which I think would allow you to
> > simply change the "Frame Index" and avoid the cost of blitting.
> >
> > Only problem is that looking at the pyopenGL docs nothing like this leaps
> > out at me. :-/ Anyone know off hand if something like this works?
>
> Jasper, I've written some tools which do exactly this. The sprite is
> loaded with a filmstrip image, and you simply change the frame
> attribute to control which frame you want to blit to the screen.
>
> It uses OpenGL so it is very very fast :)
>
> You can get it from http://metaplay.com.au/tarballs/LGT.tar.bz2
Ahhh. I see, you just tweak the arguments to glTexCoord and glVertex.
D'oh! The answer was staring me right in the face all the while I was
hunting for some specialized function. :-(
Thanks for the tip!
-Jasper
PS Incidentally, in Video.Screen.blit(), aren't your args to glVertex3f off
by one? Take a sprite 64 pixels high for example, for which you would have
vertices at -32 and 32 y -- for a spread of 65. Not a big deal if you're
making full use of 3D, but wouldn't this cause an interpolation artifact in
orthogonal view, with 64 image-pixels being stretched to fit into 65
screen-pixels?