Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
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?.
You’re right to use distance, but you also need to incorporate the connectedness of the vertices in your algorithm. To do this you’ll want to use some sort of recursive breadth first or depth first search algorithm that stops recursing if the vertices are outside the given radius from the root vertex or point of selection.
- Find the closest vertex to your selection point
- Recurse through the root vertex’s children
- Stopping if the child is outside the selection radius
Not the answer you’re looking for? Browse other questions tagged vertex or ask your own question.