Announcement

Collapse
No announcement yet.

Found neighbour triangles

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Found neighbour triangles

    Hi

    For my custom implementation i need to found neighbour triangles by edge for current triangle. For example triangle with vertex indices 0,1,2 is neighbour for triangle with inidcies 0,2,3 and second neighbour is 0,1,4

    But UE is add duplicates vertices when importing mesh and compare just by vertex indices is not possible. What the best and fast way to find triangle neighbours?


    Click image for larger version  Name:	Untitled10.jpg Views:	1 Size:	126.9 KB ID:	1661778
    Last edited by Andy_rst; 09-06-2019, 07:06 PM.
    HUD links | Crane Balk | Point Clouds Morphing | Rain Drops | Manipulator Robot | Welder Robot | Mini Games | Masked Blur | Voxel Cars

    #2
    It sounds like you need to build a spatial index of vertices. It looks like UE4 has an Octree class. Octree is a spatial index very similar to a binary search tree in 3d space. It looks like there is also a KDTree plugin. A KDTree is another spatial index.

    You can put your vertices or polygon centroids inside of one of these spatial indexes, and then do a lookup for the nearest neighbors, probably in log(n) time.

    Comment


      #3
      Originally posted by amoffat View Post
      A KDTree is another spatial index.
      Thanks! Seems that k-d tree is good approach for me.

      HUD links | Crane Balk | Point Clouds Morphing | Rain Drops | Manipulator Robot | Welder Robot | Mini Games | Masked Blur | Voxel Cars

      Comment

      Working...
      X