The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Continuous Collision Detection David Knott COMP 259 class presentation.

Slides:



Advertisements
Similar presentations
2.5. B ASIC P RIMITIVE I NTERSECTION Details of common forms of primitive intersection test.
Advertisements

Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
2.3. B OUNDING V OLUMES Bounding volumes of use for collision detection.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Collision Detection and Resolution Zhi Yuan Course: Introduction to Game Development 11/28/
Computer graphics & visualization Collisions. computer graphics & visualization Simulation and Animation – SS07 Jens Krüger – Computer Graphics and Visualization.
Geometry Primer Lines and rays Planes Spheres Frustums Triangles Polygon Polyhedron.
Geometric Representations & Collision Detection Kris Hauser I400/B659: Intelligent Robotics Spring 2014.
Continuous Collision Detection: Progress and Challenges Gino van den Bergen dtecta
Introduction to Collision Detection & Fundamental Geometric Concepts Ming C. Lin Department of Computer Science University of North Carolina at Chapel.
Advanced Computer Graphics Spring 2014
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
A Fast Algorithm for Incremental Distance Calculation Paper by Ming C. Ling and John F. Canny Presented by Denise Jones.
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
Collision Detection CSE 191A: Seminar on Video Game Programming Lecture 3: Collision Detection UCSD, Spring, 2003 Instructor: Steve Rotenberg.
1cs533d-winter-2005 Notes  More optional reading on web for collision detection.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
GPU Proximity Queries with Swept Sphere Volumes COMP Robotics Project Proposal Qi Mo.
Self-Collision Detection and Prevention for Humonoid Robots Paper by James Kuffner et al. Presented by David Camarillo.
Adaptive Dynamic Collision Checking for Many Moving Bodies Mitul Saha Department of Computer Science, Stanford University. NSF-ITR Workshop Collaborators:
UNC Chapel Hill M. C. Lin References Collision Detection between Geometric Models: A Survey, by M. Lin and S. Gottschalk, Proc. of IMA Conference on Mathematics.
Self-Collision Detection and Prevention for Humonoid Robots Paper by James Kuffner et al. Jinwhan Kim.
1 Geometry A line in 3D space is represented by  S is a point on the line, and V is the direction along which the line runs  Any point P on the line.
Adapted from: CULLIDE: Interactive Collision Detection Between Complex Models in Large Environments using Graphics Hardware Naga K. Govindaraju, Stephane.
CS 326 A: Motion Planning robotics.stanford.edu/~latombe/cs326/2004/index.htm Collision Detection and Distance Computation.
OBBTree: A Hierarchical Structure for Rapid Interference Detection Gottschalk, M. C. Lin and D. ManochaM. C. LinD. Manocha Department of Computer Science,
1cs533d-term Notes  list Even if you’re just auditing!
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Collision Detection for Deformable Objects Xin Huang 16/10/2007.
Apex Point Map for Constant-Time Bounding Plane Approximation Samuli Laine Tero Karras NVIDIA.
Collision Detection CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
CS 326A: Motion Planning ai.stanford.edu/~latombe/cs326/2007/index.htm Collision Detection and Distance Computation.
1 Single Robot Motion Planning Liang-Jun Zhang COMP Sep 22, 2008.
Collision Detection David Johnson Cs6360 – Virtual Reality.
CS B659: Principles of Intelligent Robot Motion Collision Detection.
Computer graphics & visualization Collision Detection – Narrow Phase.
11/25/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Managing large numbers of objects Colliding spheres with things (spheres being common.
12/4/2001CS 638, Fall 2001 Today Using separating planes/axes for collision testing Collision detection packages.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
CSE 381 – Advanced Game Programming Quickhull and GJK.
Collision handling: detection and response
3D Graphics for Game Programming Chapter XII Physics-based Simulation.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Collisions & Contact.
Week 13 - Monday.  What did we talk about last time?  Exam 2!  Before that…  Polygonal techniques ▪ Tessellation and triangulation  Triangle strips,
Quick-CULLIDE: Efficient Inter- and Intra- Object Collision Culling using Graphics Hardware Naga K. Govindaraju, Ming C. Lin, Dinesh Manocha University.
Collision/Acceleration University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 6, 2002 Day 10.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Computer Game Design and Development
Chapter 11 Collision Detection 가상현실 입문 그래픽스 연구실 민성환.
Presented by Paul Phipps
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Interactive Continuous Collision Detection for Polygon Soups Xin Huang 11/20/2007.
A Fast Algorithm for Incremental Distance Calculation Ming C. Lin & John Canny University of California, Berkeley 1991 Presentation by Adit Koolwal.
Minkowski Sums and Distance Computation Eric Larsen COMP
Collision Detection Spring 2004.
Parts of these slides are based on
References Additional lecture notes for 2/18/02.
Chapter 4.2 Collision Detection and Resolution
Collision handling: detection and response
Craig Schroeder October 26, 2004
2.5. Basic Primitive Intersection
References Collision Detection between Geometric Models: A Survey, by M. Lin and S. Gottschalk, Proc. of IMA Conference on Mathematics of Surfaces 1998.
Computer Animation Algorithms and Techniques
Collision Detection.
David Johnson Cs6360 – Virtual Reality
GPAT – Chapter 7 Physics.
Presentation transcript:

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Continuous Collision Detection David Knott COMP 259 class presentation

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Interference vs. Collision Most algorithms that we think of as collision detection are actually Interference Detection ♦ Interference Detection: Static setting ♦ Collision Detection: Dynamic setting Most collision detection algorithms consist of repeated application of interference detection

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Why Perform Continuous CD? The exact time and location of first contact may need to be found.

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Why Perform Continuous CD? Sampling at discrete intervals may miss a collision entirely.

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Why Perform Continuous CD? Sampling at discrete intervals may give the wrong collision!

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Why Perform Continuous CD? Most animation systems use backtracking methods ♦ Try to find point of first contact by binary search. ♦ Subject to all problems from previous slides ♦ Especially poor for non-solid objects (eg. cloth)

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Types of motion Almost all CCD algorithms assume linear motion over a single time step Non-linear motion makes CCD computation much more expensive ♦ True for both approximate and exact methods

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Swept-volumes The motion of a primitive through space “sweeps out” a volume over a time interval ♦ Similar to extrusion with an added rotational component.

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Swept Volumes Swept-Volumes of moving objects may be compared against each other This is a binary test for collision ♦ Does not reveal when or where collision occurs

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Swept Volumes Swept volumes are a sufficient but not necessary condition for determining if objects are collision-free ♦ Swept volumes may overlap, even when the objects have not collided ♦ Subdivision is needed ♦ Or consider relative motion

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Swept volumes in 3D space 1D - line 2D – prism 3D ♦ becomes very complicated very quickly a b a'a' b'b' a a'a'

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Swept Volumes A object in n dimensions sweeps out a volume in n+1 dimensions These volumes are very expensive to compute. ♦ Even harder with arbitrary rotations.

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Swept Volumes Source: “Fast Swept Volume Approximation…” Y. Kim – ACM Solid Modelling 2003

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Approximate CCD Rough (conservative) CCD tests can be performed via bounding volumes of the swept volumes Hierarchies of bounding volumes may be constructed

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Convex Hulls of Swept Volumes “A Safe Swept-Volume Approach to Collision Detection” A. Foisy & V. Hayward Int. Symp. on Robotics Research 1994

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Convex Hulls of Swept Volumes The AABB of a moving vertex Can find the convex hull of the AABBs of all vertices

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Convex Hulls of Swept Volumes The convex hull of vertex AABBs is also a convex approximation to the swept volume of the moving object Can consider hierarchies of these But NOT the convex hull of the AABBs.

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Convex Hulls of Swept Volumes Can compute bounding boxes of the motion of individual vertices ♦ From this, a convex approximation of the object’s swept volume is straightforward If bounding volumes test positive, then individual polygon primitives must be tested ♦ Similar to discrete bounding volumes

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Four-Dimensional Extrusion Extrude an object from N-dimensional space into N+1 dimensional space ♦ eg. 2D object extruded through time to form 3D object “Collision Detection by 4D Intersection Testing…” ♦ J. Cameron – IEEE Trans. Robotics & Automation

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Four-Dimensional Extrusion Not the same as swept volumes ♦ Swept volumes compute sweep of the boundary of the surface ♦ 4D extrusion computes sweep of volume ♦ Overlap of extruded volumes is a necessary and sufficient condition for collision. Conceptually nice Implementation is exceedingly difficult

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Exact CCD Swept volumes and bounding volumes will only report potential collisions. Still need to determine the exact time and point of collision. The types of objects that are being tested are usually polygonal ♦ How can the exact tests be done for polyhedra?

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Exact CCD: How may two polygons collide? Vertex/Face Collision Edge/Edge Collision

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Exact CCD “Collision Detection for Moving Polyhedra” ♦ J.Canny – IEEE Patt. Anal. and Mach. Int CCD for both the edge/edge and vertex/face tests reduces to a system of constraints and solving a polynomial of degree 5

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Vertex/Face Collision when vertex/face distance is zero Check for point/plane coplanarity Then check for vertex/face intersection validity

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Edge/Edge Collision when edge/edge distance is zero Check for line/line coplanarity Then check for edge/edge intersection validity

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Edge/Edge and Vertex/Face Note that both types of tests are of the form: ♦ Find when four points are co-planar (continuous) ♦ Check for validity at time of co-planarity (in-plane distance computation) When two primitives have more than one contact during a single time step – choose the first one

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Co-Planarity Test For both edge/edge and vertex/face, the test has the form: Assuming linear motion, this equation is cubic in the time variable May be solved directly for all triangle pairs “Collision and Self-Collision Handling…” ♦ X. Provot - Graphics Interface 1997 ♦ Application: Cloth collision detection

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Solving the Equations This could be solved directly. Solving a cubic directly is difficult and expensive. Most implementations use bisection or similar methods to find the roots of the equations. Is there a better way to do this?

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Interval Arithmetic Compute with intervals instead of numbers I = [a,b] = {x ,a  x  b} Vectors have interval components Given a function f(x), then computation of f(I) results in another interval “Interval Analysis for Computer Graphics” “Interval Methods for Multi-Point Collisions…” ♦ J. Snyder – SIGGRAPH 1992/1993

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Interval Arithmetic Operations [a,b]  [c,d]= [a  c,b  d] [a,b]  [c,d]= [a  d,b  c] [a,b]  [c,d]= [min(ac,ad,bc,bd),max(ac,ad,bc,bd)] 1/[a,b] = [1/b,1/a] if a>0 or b<0 [a,b]  [c,d] if b  c

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Interval Arithmetic - example Consider the function: over the time interval [0,  /2] We have the bounds: Therefore:

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Interval arithmetic Function bounds are not exact ♦ But become tight as size of time interval approaches zero

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Interval Arithmetic – solving Given bounds function f(x)=0, with interval I=[m,n] and tolerance  SOLVE( m, n ) bounds = f([m,n]) If bounds  [0,1] return(false) else If width(bounds)<  and m is a valid root return(true) else if SOLVE( m, (m+n)/2 ) return(true) else return(SOLVE( (m+n)/2, n ) )

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Bounding Spheres Two spheres overlap when: c 2 and c 1 can be bounded ♦ their limits all three dimensions are known from the linearized equations of motion ♦ so solve using interval arithmetic

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Axis-Aligned Bounding Boxes Can find AABBs that bound an object over an interval ♦ Linear motion of a vertex can be bounded by an AABB ♦ AABB of object is the combination of all vertex AABBs. Use interval arithmetic to solve standard AABB test ♦ AABB bounds are the input

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Oriented Bounding Boxes “Fast Continuous Collision Detection Between Rigid Bodies” S. Redon, A. Kheddar, & S. Coquillart Eurographics 2002

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Oriented Bounding Boxes Tighter fit than AABBs Overlap test is based on concept of separating axes

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Oriented Bounding Boxes What if the OBBs of objects are animated? This is easy to do for rigid objects ♦ Apply the object’s transformation to the OBB ♦ Not the same as an OBB of the swept volume The static OBB overlap tests are relatively straightforward equations ♦ They can be performed continuously as well!

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL OBB Test Define an OBB by three axes a 1, a 2, a 3, with half-sizes a 1, a 2, a 3, and center C An axis, x, separates two OBBs, A and B, if and only if: There are fifteen such axes If all fifteen tests fail, then the OBBs overlap

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL OBB Test – Example in 2D

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Continuous OBB Test The separating axis values, a i, a i, and C can be easily bounded. So the separation equations can be computed with interval arithmetic.

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Application - Cloth Cloth simulation presents a particular challenge for both discrete and continuous collision detection “Interactive Collision Detection between Deformable Models using Chromatic Decomposition” - SIGGRAPH 2005 submission

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Cloth Cloth is not modeled as a solid ♦ Usually a non-closed polygonal surface ♦ Interpenetrations are very noticable ♦ Discrete sampling is very likely to miss collisions

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Cloth Cloth is highly deformable Cloth may exhibit self-collision Collision detection is the major bottleneck in cloth simulation

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Cloth CCD Typical approach is AABB, followed by edge/edge and vertex/face CCD for all polygon pairs ♦ VERY expensive ♦ Potentially hundreds of millions of pairs Swept volumes of polygonal primitives cannot be used ♦ Adjacent polygons will be false positives

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Our approach Perform swept-volume CCD, but ensure that adjacent polygons are not checked Accomplished through chromatic decomposition ♦ Divide the cloth into disjoint sets of polygons ♦ Check disjoint sets against each-other

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Our Approach Swept-volume tests are GPU- accelerated Exact triangle/triangle tests are done using interval arithmetic ♦ Number of required tests is greatly reduced

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Other Issues in CCD Many collisions in close temporal proximity  Small time steps ♦ Especially bad for real-time applications ♦ Can process groups of collisions that are known to be happening almost simultaneously

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Other Issues in CCD Continuous and almost-continuous contact ♦ Resting/sliding motion ♦ Swept volumes and bounding volumes cannot help ♦ This is a problem in both discrete and continuous CD ♦ Such contacts need to be tracked separately