Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Assigning vertices to Triangles dynamically for mesh generation.

Discussion in 'Scripting' started by joshua2880, Aug 14, 2019 at 6:52 AM.

  1. joshua2880

    joshua2880

    Joined:
    Wednesday
    Posts:
    2
    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:
    1,422
    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:
    Wednesday
    Posts:
    2
    I'm looking to initially combine the whole array into a single mesh each frame, so no need to divide up the points.