Jump to content

mesh Plane and Rope in new Versions


ErfanAsgari
 Share

Recommended Posts

Hi,

I was trying to use Pixi.mesh.Plane to wrap an image around a mug.  you can see the functionality I'm looking for in the attached image.

the problem is the fact that Pixi.mesh.Plane and Rope and such constructors are not available in new versions anymore (I'm using the 6.0.4).

can you help me with introducing newer version alternatives or giving me an even better solution to do so?

thanks!

pattern_on_mug.jpg

Link to comment
Share on other sites

https://github.com/pixijs/pixijs/blob/4d92e01380417d10e80624dfa5360bfe0708628c/packages/mesh-extras/src/SimpleMesh.ts#L53-L56

That's the access. 

However pixi needs to be notified that you changed something in array. "autoUpdate" feature works only in Rope: https://github.com/pixijs/pixijs/blob/4d92e01380417d10e80624dfa5360bfe0708628c/packages/mesh-extras/src/SimpleRope.ts#L61 , however even simple MeshMaterial doesnt have this option.

So, what to do? manually call buffer update every time you change something.  "this.geometry.getBuffer('aVertexPosition').update()"

Im currently not sure why isnt it called or whether its called. "pixi-spine" works fine so it should workeven without it?

Edited by ivan.popelyshev
Link to comment
Share on other sites

Thanks It works properly. Is there anyway to use mesh for a container instead of a texture?

I mean I have a container for the pattern which I want to put on the mug I mentioned before which has its own effects and sprites. I would be glad if there were anyway to do so.

 

Link to comment
Share on other sites

You can render contents of container to renderTexture and then use it in mesh, that's how it usually done in all renderers.

Actual curved space for container is also possible if you have both direct and inverted formulas for curved space and aren't afraid of messy sharers, so far i was the only one who ever did that in pixi, here's bilinear space:

https://github.com/pixijs/pixi-projection/tree/master/src/curve

https://pixijs.io/examples/#/plugin-projection/quad-bi.js

 

Edited by ivan.popelyshev
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...