Title: GJK Supplement
1GJK Supplement
- Reference SIGGRAPH2004 Course Note
- Original Reference
- A Fast Procedure for Computing the Distance
between Objects in Three-Dimensional Space, by E.
G. Gilbert, D. W. Johnson, and S. S. Keerthi, In
IEEE Transaction of Robotics and Automation, Vol.
RA-4193--203, 1988.
2Introduction
- Find Euclidean distance (and closest points)
between the convex hulls of two point sets - If disjoint, also find the separation axis
- If collision, can be enhanced to find penetration
depth
3Introduction (cont)
- Simplex-based descent algorithm
- d-simplex the convex hull of d1 independent
points in d-dimensional space
4Demonstration
Proximity Query (minimum distance)
Penetration Depth
5Properties
- Distance
- distance(A,B) min a?A,b? B a b 2
- distance(A,B) min c ? A?B c 2
- if A and B disjoint, c is a point on boundary of
Minkowski difference - Penetration Depth
- pd(A,B) min t 2 A ? Translated(B,t) ?
- pd(A,B) mint ? A?B t 2
- if A and B intersect, t is a point on boundary of
Minkowski difference
6Support Mapping
7Simplified Version
Find the distance between the CH and origin
8Example 1(4)
Q A
- A is the point of minimum norm in CH(Q)
- Q is irreducible
- Find B in direction of A
- Add B to Q
9Example 2(4)
- Q A,B
- C is the point of minimum norm
- Q is irreducible
- Find D in direction of C
- Add D to Q
D
10Example 3(4)
- Q A,B,D
- E is the point of minimum norm
- Reduce Q to B,D
- Find F in direction of E
- Add F to Q
F
11Example 4(4)
- Q B,D,F
- G is the point of minimum norm
- Reduce Q to D,F
- Cannot find lower support in direction of G
- G is the closest point
12Example 1(3)
QA A has minimum norm Find B in direction of
A Add B to Q
A
B
13Example 2(3)
QA,B C has minimum norm Q is irreducilble Find
D in direction of C Add D to Q
QA,B C has minimum norm Q is irreducilble Find
D in direction of C Add D to Q
A
D
C
B
14Example 3(3)
QA,B,D Pt of minimum norm is origin Polygon
contains origin distance 0
A
D
B
15Estimating Penetrating Depth (ref)
Start with the triangle containing origin
Expanding polytope
16Example 1(3)
Start from ABD, the triangle containing
origin Expanding, find E
A
D
E
B
17Example 2(3)
Find closest edge Expanding, find F
A
D
F
E
B
18Example 3(3)
Find closest point Expanding, find no more. End.
A
D
F
E
B
19Time Complexity for Finding a Support Vertex
20Running Time of GJK
- Each iteration of the while loop requires O(n)
time. - O(n) iterations possible. The authors claimed
between 3 to 6 iterations on average for any
problem size, making this expected linear. - Trivial O(n) algorithms exist if we are given the
boundary representation of a convex object, but
GJK will work on point sets - computes CH lazily.
21More on GJK
- Given A CH(A) A a1, a2, ... , an and
- B CH(B) B b1, b2, ... , bm
- A?B CH(P), P a b a? A, b? B
- Can compute points of P on demand
- p-x a-x - bx where a-x is the point of A
extremal in direction -x, and bx is the point of
B extremal in direction x. - The loop body would take O(n m) time, producing
the expected linear performance overall.
22Distance Between A B
23Sampling Minkowski Difference
(8,5) (4,4) (-4,-1)
Not explicitly compute the Minkowski
difference. Only samples the point set using the
support mapping
24Algorithm d(A,B)
25Example 1(4)
Sampling A?B
(8,5) (4,4) (-4,-1)
26Example 2(4)
(2,1) (1,2) (-1,1)
27Example 3(4)
28Example 4(4)
Note this also defines the separation axis
d sqrt(122)
29GJK for Moving Objects
time interval is short enough to assume constant
velocity movement
30Swept Volume
as convex hull of start and end polygon?!
31Sampling Swept Volume
32Get Time of Collision via Bisection
33HW Compute the Penetration Depth
A
B