Fast Penetration Depth Computation for Physicallybased Animation http
Fast Penetration Depth Computation for Physically-based Animation http: //gamma. cs. unc. edu/PD Y. Kim, M. Otaduy, M. Lin and D. Manocha Computer Science UNC – Chapel Hill http: //gamma. cs. unc. edu/PD
Proximity Queries and PD d Collision Detection d Separation Distance Penetration Depth http: //gamma. cs. unc. edu/PD
Definition · Penetration Depth (PD) - Minimum translational distance to separate two intersecting objects PD http: //gamma. cs. unc. edu/PD
Motivation · Contact Handling in Rigid Body Simulation - Time stepping method » Check the contact at fixed intervals - Penalty-based method http: //gamma. cs. unc. edu/PD
Motivation · Time stepping method - Estimate the time of collision (TOC) T = t 0 T = t 1 T=t? T = t 2 http: //gamma. cs. unc. edu/PD
Motivation · Time stepping method using PD 1. Compute the penetration depth 2. Estimate the TOC by interpolation in time domain T = t 1 T = tk T = t 2 http: //gamma. cs. unc. edu/PD
Motivation · Penalty-based Method T = t 0 T = t 1 T = t 2 http: //gamma. cs. unc. edu/PD
PD Application · Rigid body dynamic simulation · Robot motion planning for autonomous agents and animated characters · Haptic rendering · Tolerance verification for CAD models http: //gamma. cs. unc. edu/PD
Previous Work · Convex polytopes - [Cameron ’ 86 ’ 97], [Dobkin et al. ’ 93], [Agarwal et al. ’ 00], [Bergen ’ 01], [Kim et al. ’ 02] · Local solutions for deformable models - [Susan and Lin ’ 01], [Hoff et al. ’ 01] · No solutions existed for non-convex models http: //gamma. cs. unc. edu/PD
Overview · Preliminaries - Minkowski sum-based Framework · Basic PD Algorithm: A Hybrid Approach · Acceleration Techniques - Object Space Culling - Hierarchical Refinement - Image Space Culling · Application to Rigid Body Dynamic Simulation http: //gamma. cs. unc. edu/PD
Overview · Preliminaries - Minkowski sum-based Framework · Basic PD Algorithm: A Hybrid Approach · Acceleration Techniques - Object Space Culling - Hierarchical Refinement - Image Space Culling · Application to Rigid Body Dynamic Simulation http: //gamma. cs. unc. edu/PD
Preliminaries · Local solutions might not have any relevance to a global solution PD Global PD solution Local PD solutions http: //gamma. cs. unc. edu/PD
Preliminaries · Minkowski sum and PD - P -Q = { p-q | p P, q Q } - PD : = minimum distance between OQ-P and the surface of P -Q P Q OP OQ-P P -Q OQ http: //gamma. cs. unc. edu/PD
Preliminaries · Minkowski sum and PD - P -Q = { p-q | p P, q Q } - PD : = minimum distance between OQ-P and the surface of P -Q P Q OP OQ OQ-P P -Q http: //gamma. cs. unc. edu/PD
Preliminaries · Decomposition property of Minkowski sum - If P = P 1 P 2 , then P Q = (P 1 Q) (P 2 Q) · Computing Minkowski sum - Convex: O(n log(n)) » where n is the number of features - Non-Convex: O(n 6) computational complexity » In theory, use the convolution or the decomposition property » In practice, very hard to implement. http: //gamma. cs. unc. edu/PD
Overview · Preliminaries - Minkowski sum-based Framework · Basic PD Algorithm: A Hybrid Approach · Acceleration Techniques - Object Space Culling - Hierarchical Refinement - Image Space Culling · Application to Rigid Body Dynamic Simulation http: //gamma. cs. unc. edu/PD
PD Algorithm : A Hybrid Approach · P Q = (P 1 Q) (P 2 Q) - where P = P 1 P 2 http: //gamma. cs. unc. edu/PD
PD Algorithm : A Hybrid Approach · P Q = (P 1 Q) (P 2 Q) - where P = P 1 P 2 http: //gamma. cs. unc. edu/PD
PD Algorithm : A Hybrid Approach · P Q = (P 1 Q) (P 2 Q) - where P = P 1 P 2 · Precomputation: Decomposition http: //gamma. cs. unc. edu/PD
PD Algorithm : A Hybrid Approach · P Q = (P 1 Q) (P 2 Q) Q - where P = P 1 P 2 · Precomputation: Decomposition · Runtime: - Object Space: Pairwise Minkowski sum computation http: //gamma. cs. unc. edu/PD
PD Algorithm : A Hybrid Approach · P Q = (P 1 Q) (P 2 Q) - where P = P 1 P 2 · Precomputation: Decomposition · Runtime: - Object Space: Pairwise Minkowski sum computation - Image Space: Union by graphics hardware http: //gamma. cs. unc. edu/PD
PD Computation Pipeline Precomputation Convex Decomposition Run-time PD Query Pairwise Minkowski Sum (Object Space) Closest Point Query (Image Space) http: //gamma. cs. unc. edu/PD
Convex Surface Decomposition · [Ehmann and Lin ’ 01] · Decompose an object into a collection of convex surface patches · Compute the convex hull of each surface patch http: //gamma. cs. unc. edu/PD
Pairwise Minkowski Sum · Algorithms - Convex hull property of convex Minkowski sum » P Q = Conv. Hull{vi+vj| vi VP, vj VQ}, where P and Q are convex polytopes. - Topological sweep on Gauss map [Guibas ’ 87] - Incremental surface expansion [Rossignac ’ 92] http: //gamma. cs. unc. edu/PD
Closest Point Query · Goal - Given a collection of convex Minkowski sums, compute the shortest distance from the origin to the surface of their union - An exact solution is computationally expensive Approximation using graphics hardware http: //gamma. cs. unc. edu/PD
Closet Point Query · Main Idea - Incrementally expand the current front of the boundary http: //gamma. cs. unc. edu/PD
Closest Point Query 1. Render front faces, and open up a window where z-value is less than the current front 2. Render back faces w/ z-greater-than test 3. Repeat the above m times, where m : = # of obj’s http: //gamma. cs. unc. edu/PD
Closest Point Query 1. Render front faces, and open up a window where z-value is less than the current front 2. Render back faces w/ z-greater-than test 3. Repeat the above m times, where m : = # of obj’s http: //gamma. cs. unc. edu/PD
Overview · Preliminaries - Minkowski sum-based Framework · Basic PD Algorithm: A Hybrid Approach · Acceleration Techniques - Object Space Culling - Hierarchical Refinement - Image Space Culling · Application to Rigid Body Dynamic Simulation http: //gamma. cs. unc. edu/PD
Motivation · PD is shallow in practice. · Convex decomposition has O(n) convex pieces in practice. Culling strategy is suitable and very effective. http: //gamma. cs. unc. edu/PD
Object Space Culling · Basic Idea - If we know the upper bound on PD, u. PD , we do not need to compute the Mink. sum of pairs whose Euclidean dist is more than u. PD http: //gamma. cs. unc. edu/PD
Object Space Culling · Basic Idea - If we know the upper bound on PD, u. PD , we do not need to compute the Mink. sum of pairs whose Euclidean dist is more than u. PD PD u. PD http: //gamma. cs. unc. edu/PD
Object Space Culling · Basic Idea - If we know the upper bound on PD, u. PD , we do not need to compute the Mink. sum of pairs whose Euclidean dist is more than u. PD http: //gamma. cs. unc. edu/PD
Image Space Culling · Rendering only once for the Minkowski sums containing the origin · Refine the upper bound for every view frustum · View frustum culling http: //gamma. cs. unc. edu/PD
Hierarchical Culling · BVH Construction (Ehmann and Lin ’ 01) · Hierarchical Culling http: //gamma. cs. unc. edu/PD
Hierarchical Culling · BVH Construction (Ehmann and Lin ’ 01) · Hierarchical Culling http: //gamma. cs. unc. edu/PD
Hierarchical Refinement Precomputation Convex Decomposition BVH Construction Run-time PD Query Culling Pairwise Minkowski Sum Closest Point Query Refine the current PD estimate, and go to the next level of BVH http: //gamma. cs. unc. edu/PD
PD Benchmarks Touching Tori Interlocked Grates Touching Alphabets 0. 3 sec (4 hr) 3. 7 sec (4 hr) 1. 9 sec (177 hr) 0. 4 sec (7 min) • With Accel. (Without Accel. ) http: //gamma. cs. unc. edu/PD
PD Benchmarks Models Tri Convex Pieces PD w/o Accel. PD w/ Accel Touching Tori 2000 67 4 hr 0. 3 sec Interlocked Tori 2000 67 4 hr 3. 7 sec 177 hr 1. 9 sec 7 min 0. 4 sec Interlocked Grates 444, 1134 169, 409 Touching Alphabets 144, 152 42, 43 http: //gamma. cs. unc. edu/PD
Hierarchical Culling Example Level Cull Ratio 3 31. 2% 5 96. 7% 7 98. 3 % Mink Sum 0. 219 sec 0. 165 sec 1. 014 sec HW Query 0. 220 sec 0. 146 sec 1. 992 sec PDest 0. 99 0. 53 0. 50 http: //gamma. cs. unc. edu/PD
Implementation · SWIFT++ [Ehmann and Lin ’ 01] · QHULL · Open. GL for closest point query http: //gamma. cs. unc. edu/PD
Implementation void Draw. Union. Of. Convex(Convex. Obj *Convex. Objs, int Num. Convex. Objs) { gl. Clear. Depth(0); gl. Clear. Stencil(0); gl. Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); gl. Enable(GL_DEPTH_TEST); gl. Enable(GL_STENCIL_TEST); for (int i=0; i<Num. Convex. Objs; i++) for (int j=0; j<Num. Convex. Objs; j++) { gl. Depth. Mask(0); gl. Color. Mask(0, 0, 0, 0); gl. Depth. Func(GL_LESS); gl. Stencil. Func(GL_ALWAYS, 1, 1); gl. Stencil. Op(GL_KEEP, GL_REPLACE, GL_KEEP); Convex. Objs[j]. Draw. Front. Faces(); } } gl. Depth. Mask(1); gl. Color. Mask(1, 1, 1, 1); gl. Depth. Func(GL_GREATER); gl. Stencil. Func(GL_EQUAL, 0, 1); gl. Stencil. Op(GL_ZERO, GL_KEEP); Convex. Objs[j]. Draw. Back. Faces(); http: //gamma. cs. unc. edu/PD
Accuracy of PD computation · Our algorithm computes an upper bound to PD · Image space computation determines the tightness of the upper bound - Pixel resolution - Z-buffer precision · In practice, with 256 pixel resolution, the algorithm rapidly converges to the PD http: //gamma. cs. unc. edu/PD
Overview · Preliminaries - Minkowski sum-based Framework · Basic PD Algorithm: A Hybrid Approach · Acceleration Techniques - Object Space Culling - Hierarchical Refinement - Image Space Culling · Application to Rigid Body Dynamic Simulation http: //gamma. cs. unc. edu/PD
Application to Rigid Body Simulation · Interpenetration is often unavoidable in numerical simulations · Need for a consistent and accurate measure of PD · Penalty-based Method - F = (k • d)n » d: PD, n: PD direction, k: stiffness constant http: //gamma. cs. unc. edu/PD
Application to Rigid Body Simulation · Time Stepping Method - Estimate the time of collision (TOC) » s: separation dist before interpenetration » d: PD, n: PD dir after interpenetration » vs: relative velocity of closest features » vd: relative velocity of PD features http: //gamma. cs. unc. edu/PD
Application to Rigid Body Simulation - x(t) : 1 D distance function between closest features and PD features projected to PD direction - x(0) = s, x(T) = d - dx/dt(0) = vs • n, dx/dt(T) = vd • n - Compute the roots of x(t) = 0 http: //gamma. cs. unc. edu/PD
Rigid Body Simulation Demo Example 1 Average complexity: 250 triangles 60 Convex Pieces / Object Example 2 Average complexity: 250 triangles 200 letters and alphabets http: //gamma. cs. unc. edu/PD
Rigid Body Simulation Demo http: //gamma. cs. unc. edu/PD
Contributions · First practical PD algorithm using a hybrid approach · Acceleration techniques: - Object space culling - Image space culling - Hierarchical refinement · Application to rigid body simulation http: //gamma. cs. unc. edu/PD
Future Work · More optimizations on - Closest point query - Pairwise Minkowski sum · More performance comparisons - Accuracy and running time of PD algorithm - Other RBD simulation approaches · Extension to rotational PD http: //gamma. cs. unc. edu/PD
Acknowledgement · Kenneth Hoff · Stephen Ehmann · ARO · DOE · NSF · ONR · Intel http: //gamma. cs. unc. edu/PD
Thank you http: //gamma. cs. unc. edu/PD
- Slides: 53