So I need to snap any floating point in 3D space to the nearest point on a sphere, the size of the sphere also needs to change as the point gets further from the origin, idk if that made sense or I'm just thinking about something incorrectly, but I made a picture of it in blender:
In the picture I have green dots which represent the possible places(there are more of them) that any point in space could snap to.. So how can I make any point in space snap to the closest green dot? And IK I could just loop through those points to check the closest one, but there are gonna be MANY of these points so its not a solution and so any point has to find its closest green dot without distance checks. An example of how this could work if I didn't need it to be on a sphere is this, So lets say I have point x, and I want to snap it to its closest green dot(here the green dot isn't a point on a sphere but actually a point on a "cartesian" grid), so to snap point x I just do round(x / gridSize) * gridSize; and that snaps x to its closest grid point, but in my case I need it on a sphere, so how can I convert that to snap to a spehre? IDK if I'm making any sesne.