pixi-projection icon indicating copy to clipboard operation
pixi-projection copied to clipboard

About the flop effect

Open MarsCaiWORD opened this issue 4 years ago • 8 comments

I want to do this. I have an idea to hide the card-to-mouse distance through the mask, but a lot of code needs to be written. Is there a more elegant and short way? 45648035f0bcf52af29c09bbe964ca58e8ad4d2e

For example, there is a way to control the area Sprite3d euler y to flip

MarsCaiWORD avatar Aug 21 '20 07:08 MarsCaiWORD

Is it in the same plane, two planes or do you want full-3d mesh?

ivanpopelyshev avatar Aug 21 '20 09:08 ivanpopelyshev

@ivanpopelyshev Which kind of code will be more streamlined? I currently use Sprite3d to create a card, and the entire card can be flipped through skew, but like the GIF above, I don’t know how to proceed. Can you give me some ideas? thank you

MarsCaiWORD avatar Aug 21 '20 10:08 MarsCaiWORD

You need a Mesh, not sprite. Maybe SimpleMesh to make it simple. Also, you have to calculate the geometry yourself, pixijs does not have any instruments to get intersections of your lines or physics to drag this corner.

Regular pixijs stuff. Add projection plugin when you are ready :)

ivanpopelyshev avatar Aug 21 '20 10:08 ivanpopelyshev

2 Meshes actually, each of 4 vertices.

ivanpopelyshev avatar Aug 21 '20 10:08 ivanpopelyshev

@ivanpopelyshev mash should be done, let me try and see thanks for your reply

MarsCaiWORD avatar Aug 21 '20 10:08 MarsCaiWORD

@ivanpopelyshev image now i code like this , I created four vertices, but how can I let him specify the size I want . Create a width * height number of vertices? My idea is that mesh1 is the back of the card and mesh2 is the face card, to control mesh2 to display the back I want, but what should I do because if I use three vertices, the card will be deformed

MarsCaiWORD avatar Aug 24 '20 11:08 MarsCaiWORD

you can just change meshv according to your slider.

As for transforms - well, position/scale/rotation still works if you need to position your card in center of screen and resize it. btw I usually use (0,0) in center.

ivanpopelyshev avatar Aug 24 '20 15:08 ivanpopelyshev

image This is the result of adjusting vertices. How can I keep him from deforming? Through the indices parameter? If it is a bit troublesome, need to calculate vertices and know which indices to display

MarsCaiWORD avatar Aug 28 '20 04:08 MarsCaiWORD