Jump to content
  • Advertisement
Sign in to follow this  
sefSale

Animation with textured quads

This topic is 4363 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!