Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the flop effect #77

Open
MarsCaiWORD opened this issue Aug 21, 2020 · 8 comments
Open

About the flop effect #77

MarsCaiWORD opened this issue Aug 21, 2020 · 8 comments
Labels

Comments

@MarsCaiWORD
Copy link

MarsCaiWORD commented Aug 21, 2020

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

@ivanpopelyshev
Copy link
Collaborator

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

@MarsCaiWORD
Copy link
Author

@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

@ivanpopelyshev
Copy link
Collaborator

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
Copy link
Collaborator

2 Meshes actually, each of 4 vertices.

@MarsCaiWORD
Copy link
Author

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

@MarsCaiWORD
Copy link
Author

MarsCaiWORD commented Aug 24, 2020

@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

@ivanpopelyshev
Copy link
Collaborator

ivanpopelyshev commented Aug 24, 2020

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.

@MarsCaiWORD
Copy link
Author

MarsCaiWORD commented Aug 28, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants