I wasted my last 2 days to do flip card animation.
Well I made it by creating a look exactly the same as the 2D uses. (and the same cordinate system).
Basicly i draw a Texture2D, when i start animation stop drawing it and start drawing same texture at same position with VertexPositionTexture ,do the animation at finish stop drawing Vertexs and go back to drawing Texture2D.
Well my question is ,is there actually a basic or better way to do this? Any shortcut to get the same look that normal 2d drawings using?
Well, you might draw the card-image in a rectangle…
Then, in update, when you want to flip the card, you subtract ‘2’ from the width of the rectangle, and add ‘1’ to the x-position until the rect. is narrow enough to be just a line…
Then you switch the texture drawn to the back of the card,
and re-expand the rectangle…
Its only 2d, but its so easy to do… Even for someone new to monogame, I think…
Alternately, you can scale your sprites using a vector2 instead of a float, so you would just scale the x-axis down and up again… (switching textures in between)
Thats true, there is no depth illusion… But it IS a cheap and easy way
…And if you don’t want to do old-school animation (would be easy with gimp, its free and has a perspective tool, but might require some time to do all the cards one by one)
all I can think of that is fairly simple, is using VertexPositionTexture… I have only used VertexPositionColor, but I gather i works much the same…
Or, you could “take a deep breath” and venture into 3d, with textured models for the cards, and you can just rotate them along any axis… That might even be a good little project size for getting INTO 3d…
Thanks for answers, I do not need 3D for my game logic so no need to go in 3D world for now. I did this because i am not an astist so drawing multiple textures in gimp at this point would be loss of work time.(Well much more then 2 days at least, i am that much bad at art : )
I just do not understand what i do is not a deafult implementation for monogame.
What exactly is your goal and what was not good enough when just scaling? What does your current solution have in terms of depth illusion that you couldn’t manage with scaling? I mentioned this in the thread you linked, but it will look better if you don’t make the transition linear. You want the rotation to be linear, so if you use scaling to give the illusion of linear rotation you need to apply a sine function to your interpolation value.
That green shape you have is called a trapezoid… As I stated above, I really think the tool you are looking for is VertexPositionTexture…
This will let you draw any shape, and CHANGE the shape dynamically… You dont even need to do anything 3d… You just move the corners by changing their coordinates…
Here is a picture of how I use vertexCOLORpositions in 2d:
Notice the black shadows on the wall… This is what you get with vertexColorPositions, but using vertexTEXTUREpositions, you can have the same kind of thing, only textured…
I think i am already doing that. My code is too messy to paste( will just waste your time) But i am using VertexPositionTexture[] and BasicEffect . I just dont get how you can easliy adjust the camera. Maybe i just struggled to much because i am a newbie.