Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Assigning vertices to Triangles dynamically for mesh generation.

Discussion in 'Scripting' started by joshua2880, Aug 14, 2019.

  1. joshua2880

    joshua2880

    Joined:
    Aug 14, 2019
    Posts:
    3
    I'm currently trying to generate irregular polyhedral meshes from arrays of vertices. I can't seem to find a technique to generate the triangle info automatically from the vertex array. The vertices themselves are updated every frame, changing in both position and number. I know how many triangles I need for a given number of vertices but am unsure how to order them to prevent a mess of intersecting triangles. Any help would be appreciated.

    Thanks
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    2,348
    Do you, at least, know which vertices are in the same polygons, or is it just an arbitrary, unordered points?

    There's no built-in feature to do this (that I know of), and it's not something that's easy to implement. I think the Google search terms that you want are "point cloud to mesh". Add "C#" if you want to try to find some preexisting code.
     
  3. joshua2880

    joshua2880

    Joined:
    Aug 14, 2019
    Posts:
    3
    I'm looking to initially combine the whole array into a single mesh each frame, so no need to divide up the points.
     
unityunity