Forum

Author Topic: Given a vertex, get list of edge-linked vertices?  (Read 1562 times)

reperry

  • Newbie
  • *
  • Posts: 19
    • View Profile
Given a vertex, get list of edge-linked vertices?
« on: March 14, 2017, 07:12:37 PM »
If I pick a vertex in a model (e.g. vert = chunk.model.vertices[0]), how can I quickly get a list of the vertices it is connected to via edges?

The only approach I can think of is to cycle through all the faces and check if that vertex is part of that face. If it is, then I can add the other vertices from that face to a list. This is not very elegant though. Is there a faster method to access the vertices that a specific vertex is connected to?

Thanks