Notifications
Clear all

[Closed] Find shortest distance between point and a mesh?

 PEN

How about taking the three closest verts and use a weighted average of those? I can see one problem with it if a face is folded between two of the verts. You could then fire a ray at that point and see if it is closer then one of the verts.

 PEN

I hate it when you guys post stuff like this as it is far more interesting then what I’m working on and I just waisted a half hour playing with it.

1 Reply
(@oatz)
Joined: 10 months ago

Posts: 0

Quoted for agreement.

Khye

Hi guys,

I had this problem when figuring out particle detections on mesh objects so I could draw trails from the particles on the UV’s of the mesh. I ended up writing a routine that would shoot a sphere of rays out from the point, and out of all the successful collisions with the object, take the intersection that had the shortest hit distance. This works but it is not fast. You can shoot more and more rays spherically from your point to achieve a finer approximation of the closest part of the mesh, or you could shoot more rays radially from a successful intersection to refine the point. This is all very brute force and if you absolutely cannot use intersections and must find the point purely without rays, I apologize. This is the method I used though, after being disatisfied with some of the other methods previously mentioned.

Thanks for your input guys. I’ll give the brute force approach a go

Page 2 / 2