I would like to select a point in a mesh, but just if it’s a vertex of the mesh. So I would like to move the mouse over the mesh and, if the pointer of the mouse is “near” a vertex, snap the mouse position over the vertex to help the user selecting the right point. Do you have any suggestion about it?
I’ve done something similar to this before to highlight faces when the cursor moves, similar to a 3d modeling program.
What you can do is cast a ray when the mouse moves, if that ray hits a mesh, get the faceId - from the faceId you can get the 3 vertices that make up that “face” by accessing the meshes vertex data.
Then convert those 3 vertices to screen space → calculate the distance between the cursor and the vertices and see if they within your desired distance.