Sign in to follow this  
sefSale

Animation with textured quads

Recommended Posts

I've decided to write a 2d game with DX9 using textured quads. I've done some projects just to see how it all works, I got the most of it, but I still don't know how to animate the quads. And by that I don't mean to move them around, I'm talking about fast switching between images to get the illusion that someone/something is moving. Let's say that an object has 30 frames of animation stored in one bitmap that I want to cycle through. I know I can cut pieces of the bitmap with StrecthRect, but how do I apply them on a primitive when I'm using SetTexture?

Share this post


Link to post
Share on other sites
You don't. You should remap the texture coordinates in your vertex data.
So the animated quads should definately be in dynamic VBs. That's how I would do it. Copyind textures around is expensive, but it depends on the scale of the project.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this