I’m trying to displace the vertices highlighted in red but the way I’m selecting the vertices for displacement is by a distance radius based on the position I click with my mouse and I end up selecting the blue vertices. I want to only select the vertices up until the edges and not passed that. Other than distance, I don’t know how to select a batch of vertices. How would I go about this?.
The answer will probably lie in following edges between the vertices (eg, using the triangles information from the mesh) to determine distance rather than just using the vertex positions.
So find the magnitude between the edge vertices and the vertices in focus and then if the magnitude is greater than the first edge you hit then don’t select it?
Not quite. I mean traverse the shortest path between the vertices along edges, summing distance.
I imagine you could use some type of AStar to dynamically find that shortest path, by having AStar traverse your mesh as if it were a graph.
It would be (I think) essentially the same problem you get with turn-based games like XCom, where if you move you have to go around obstacles, such as a long wall, which in this case is analogous to your “slot” above.