Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Character animations?

This topic is 5557 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

Hello all, I have an alright skill with opengl, and would prefereably liek to know how to do this: How can i load multiple character animations from one picture? Like, with little fighter 2( www.lf2.com i do beleive), It gives you the pictures of the sprites. each picture has about 25 o so poses, and I was wondering, how do they load each pose and make animations out of it? I have a few ideas, but I cant quite code them, and also, i wouldnt mind if anyone out there could tell me how? I think it is just loading textures from different parts of the picture, but how would i load from a specific part of the picture?????? It would REALLY help with my hand drawn 2d rpg sidescroller (like legend of mana ) Whoever helps me, i could try to return a favour, cause this is VERY important to me and crucial to continue coding my game

Share this post

Link to post
Share on other sites
using tex coordinates to split an image into 'tiles'
then draw the quad with the correct texture coordinates for each animation frame.

That's a ummm simple way...

or use a program like PhotoShop and split the pic into smaller pics of each animation. then look each as 64x64 textures and simply bind the right texture for the next animation to draw.


[edited by - BGCJR on August 4, 2003 12:31:05 AM]

Share this post

Link to post
Share on other sites
I vote for the first method (load up as a single texture and use texcoords to split frames). This is going to be faster than using multiple textures and does not look too difficult.

Share this post

Link to post
Share on other sites
Using one large file is faster, too. Because then you don''t have to re-bind the texture if you are going to draw the same sprite again, say for multiple monsters.

Share this post

Link to post
Share on other sites
Thanks guys! Could maybe i see some sample code for this though? i dont know how to split up the image to tiles, Im using vc++ with opengl, so, if you could, that would be awesome

Edit: erm... well, how could i move the picture around for the diff images of the monster chars, bushes etc. etc.?

[edited by - Quino on August 5, 2003 9:11:06 PM]

Share this post

Link to post
Share on other sites
some psuedo code:

bool DrawFrame=true;
int frame = 0;

if (DrawFrame)
float row,col;
float adjust = 1/width_of_texture.
row = (int)(frame/10);
col = (int)(frame-(row*10));
row *= adjust;
col *= adjust;


[edited by - BGCJR on August 5, 2003 9:50:43 PM]

Share this post

Link to post
Share on other sites

  • 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!