Jump to content

Custom mesh triangulation


Recommended Posts

I'm having trouble creating a custom mesh.
The documentation doesn't help much to be honest and I've looked at the source code of Plain and Rope but after that I'm still unable to get it working.
The way we did it for the past months was to extend the Rope and override the way rope works.
With this solution we're having a lot of UV issues and we have too little control so we wanna make a custom mesh.

Basically all we have to do is make a dynamic line so in the tick loop we add/remove points from the line.
This is pretty much what I made now and I've tried different draw modes and different triangulation.

So a couple questions,

  • Does the mesh update when I set the vertices, uvs and indices or is there something else that needs to be done?
  • Is there some documentation on how to do triangulation for the different draw modes?
  • Any other idea why my mesh doesn't render anything?
Link to comment
Share on other sites

I've made changes in Mesh/Rope some time ago, it supports texture regions now.

It will be totally rewamped for v5 too (there's even a branch https://github.com/pixijs/pixi.js/pull/3842 that improves rope/mesh significantly.

I've spent a lot of time on both updates, so I cant just easily describe what are you doing wrong, it's like a black hole for me, too much time spent on meshes.

Please look  https://github.com/pixijs/pixi.js/tree/dev/src/mesh , try to understand how it works. There might be bugs. Sometimes you just need to call "this.refresh(true);" one extra time. 

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.

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.


  • Recently Browsing   0 members

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