I have a surface which is a polyhedron and I want to find the minimal distance between it and a given point P. Since the polyhedron is defined by many polygons in a 3d space, one way that occurs to me is to compare the distance to each polygon and choose the shortest distance. Still I am not sure about it.
Asked
Active
Viewed 7,299 times
7
-
Is the polyhedra convex? – kennytm Mar 12 '10 at 14:41
-
At the beginning yes, but in the future might not need to be. – Sambatyon Mar 12 '10 at 14:52
-
Do you mean **polyhedron**? A surface composed of polyhedra imply you have several polyhedrons. – Jacob Mar 12 '10 at 14:55
-
You are right, I am sorry, my mistake. – Sambatyon Mar 12 '10 at 14:58
-
I think the Gilbert–Johnson–Keerthi distance algorithm is probably what I need (probably I can reduce the problem to a convex object always), however I haven't find any implementations of this algorithm. – Sambatyon Mar 12 '10 at 15:35
-
@Samba: If you need implementation, at least show us which program you'll use. – kennytm Mar 12 '10 at 18:08
1 Answers
4
Implementations of Gilbert–Johnson–Keerthi:
http://www.comlab.ox.ac.uk/stephen.cameron/distances/gjk2.4/
http://code.google.com/p/gjkd/

AVB
- 3,994
- 22
- 21