Jump to content
  • Advertisement
Sign in to follow this  
hijinks

SDL card flip.. yaw?

This topic is 4851 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'm looking to make a little card flip animation in SDL. I was using QT and their canvas widget and they have this matrix class that will handle taking a surface and turning it at the yaw?. I'm basically looking to take a surface and make it look like its flip from the back to the front. My attempts have not worked at all.. anyone have any code or pointers? Thanks Mike

Share this post


Link to post
Share on other sites
Advertisement
Are you trying to just mirror the surface? I am not up to date on my graphics vocabulary. [embarrass] If so take a look here. If not, please explain what would need to happen to get the desired effect.

Share this post


Link to post
Share on other sites
no i'm looking to do like a flip animation so you see the back of the card. and set the rotation yaw to like 45 degrees.. and it looks like the card is starting to turn over.. then set it to like 180 and the card looks just like a line.. then when its completely turned over you see the face of the card. kind of like this

so it looks like if you have a card on the table face down.. take your hand and actually flip it over so the face side is up. I want to do an animation effect. I believe thats called the yaw angle.

Share this post


Link to post
Share on other sites
You will likely need to have animation frames then. Without using OpenGL you are unable (AFAIK) to rotate a sprite with SDL. Thus you need to draw the card itself in each stage of "turn-over" and blit the next frame in the sequence to get the desired effect.

-Nightbird

Share this post


Link to post
Share on other sites
Quote:
Original post by Cocalus
You might be able to get the rotozoomer in SDL_gfx to do something simular.


Doesn't appear that way, no.

To the OP: You might be able to fake it by writing an algorithm to scale the surface, and then shrinking it horizontally. Then, once it's small enough, swap the images and grow it back out horizontally. To your idiot player, it will look almost the same.

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!