An Interest In:
Web News this Week
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
Radial Search
When I was growing up I loved to draw dot to dots, now that I'm older, I just draw more complex ones.
I'm delving into procedural generation, so picture the scene you have 20 dots randomly placed across a canvas, how can you find the nearest neighbor? Simple you might think, a simple sort of an array from smallest X to largest then for a given point you could find the index next to that point, in 1D space that would work yep but now add a Y axis. A closest point could have a similar Y and a larger X. So I got to thinking about this problem, how about a Radial search?
If I plan to have a dynamic scene of points that could be added to and removed from view by moving a camera around, it's not going to be possible to index everything and retain good performance I need to look at a given point and search outwards until I find a neighbor. The plan then is to draw a line connecting the points symbolically and physically. Point A knows about Point B and Point B knows about Point A, this is so we can skip both points and find Point C when Point B is found. The goal is to create a bunch of teselating triangles.
Is my idea horrible, how would you solve it?
Original Link: https://dev.to/adam_cyclones/radial-search-1g13
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To