ErfanAsgari Posted July 3, 2021 Share Posted July 3, 2021 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! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 3, 2021 Share Posted July 3, 2021 https://github.com/pixijs/pixijs/tree/dev/packages/mesh-extras/src `PIXI.SimplePlane` , `PIXI.SimpleRope` Quote Link to comment Share on other sites More sharing options...
ErfanAsgari Posted July 3, 2021 Author Share Posted July 3, 2021 Wow, thank you! but I cannot access mesh.vertices[i] like what https://codepen.io/erfanasgari21/pen/mdmeOra?editors=0010 does. are there any changes? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 3, 2021 Share Posted July 3, 2021 (edited) 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 July 3, 2021 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 3, 2021 Share Posted July 3, 2021 oh wait, its updated automatically: https://github.com/pixijs/pixijs/blob/4d92e01380417d10e80624dfa5360bfe0708628c/packages/mesh-extras/src/SimpleMesh.ts#L64-L67 , I didnt notice it. It should work. If its not - please post whole example. Quote Link to comment Share on other sites More sharing options...
ErfanAsgari Posted July 7, 2021 Author Share Posted July 7, 2021 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. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 7, 2021 Share Posted July 7, 2021 (edited) 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 July 7, 2021 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.