SDL card flip.. yaw?

Started by
8 comments, last by Ravuya 19 years ago
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
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.
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.
So you just want to rotate something around the x axis. Are you using OpenGL? How are you drawing your card?
"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"
i'm using the SDL library
So just SDL without OpenGL? How are you drawing the card? Just blitting a bitmap?
"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"
ya i'm just loading the bitmap on the surface.. then blitting it to the screen
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
You might be able to get the rotozoomer in SDL_gfx to do something simular.
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.

This topic is closed to new replies.

Advertisement