Collision and Proximity Queries

Similar documents
Collision Detection. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

References. Additional lecture notes for 2/18/02.

Collision Detection II. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

Collision Detection with Bounding Volume Hierarchies

Lesson 05. Mid Phase. Collision Detection

CPSC / Sonny Chan - University of Calgary. Collision Detection II

Spatial Data Structures

Spatial Data Structures

Collision Detection. Motivation - Dynamic Simulation ETH Zurich. Motivation - Path Planning ETH Zurich. Motivation - Biomedical Simulation ETH Zurich

Collision Detection. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

Using Bounding Volume Hierarchies Efficient Collision Detection for Several Hundreds of Objects

Homework 1: Implicit Surfaces, Collision Detection, & Volumetric Data Structures. Loop Subdivision. Loop Subdivision. Questions/Comments?

Dynamic Collision Detection

Bounding Volume Hierarchies

COMPUTATIONAL GEOMETRY

Spatial Data Structures

Intersection Acceleration

Collision Detection based on Spatial Partitioning

Spatial Data Structures

Overview. Collision Detection. A Simple Collision Detection Algorithm. Collision Detection in a Dynamic Environment. Query Types.

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Acceleration Data Structures

Spatial Data Structures

Overview. Collision detection. Collision detection. Brute force collision detection. Brute force collision detection. Motivation

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

Real-time Continuous Collision Detection and Penetration Depth Computation

CS535 Fall Department of Computer Science Purdue University

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

CAB: Fast Update of OBB Trees for Collision Detection between Articulated Bodies

CSG obj. oper3. obj1 obj2 obj3. obj5. obj4

improving raytracing speed

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

Collision handling: detection and response

l Without collision detection (CD), it is practically impossible to construct e.g., games, movie production tools (e.g., Avatar)

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

Accelerated Raytracing

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

Geometric Computations for Simulation

An iterative, octree-based algorithm for distance computation between polyhedra with complex surfaces 1

Accurate and Fast Proximity Queries Between Polyhedra Using Convex Surface Decomposition

Real-Time Collision Detection for Dynamic Virtual Environments

Collision Detection. Pu Jiantao.

Mobile Robot Path Planning: an Efficient Distance Computation between Obstacles using Discrete Boundary Model (DBM)

Objects DO overlap. Objects DO NOT overlap. No calculations needed.

08: CONTACT MODELLING 15/02/2016

Ray Tracing Acceleration Data Structures

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

CS 563 Advanced Topics in Computer Graphics Culling and Acceleration Techniques Part 1 by Mark Vessella

Data Structures for Approximate Proximity and Range Searching

Accelerating Geometric Queries. Computer Graphics CMU /15-662, Fall 2016

Geometry proxies (in 2D): a Convex Polygon

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Jane Li. Assistant Professor Mechanical Engineering Department, Robotic Engineering Program Worcester Polytechnic Institute

Geometric data structures:

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

GEOMETRIC TOOLS FOR COMPUTER GRAPHICS

Collision Detection CS434. Daniel G. Aliaga Department of Computer Science Purdue University

Advanced 3D-Data Structures

Collision processing

Technical Section. Tribox bounds for three-dimensional objects

MSBVH: An Efficient Acceleration Data Structure for Ray Traced Motion Blur

A Survey on Collision Detection Techniques for Virtual Environments

Ray-tracing Acceleration. Acceleration Data Structures for Ray Tracing. Shadows. Shadows & Light Sources. Antialiasing Supersampling.

Geometric Algorithms. Geometric search: overview. 1D Range Search. 1D Range Search Implementations

Computer Graphics Ray Casting. Matthias Teschner

Lecture 11: Ray tracing (cont.)

Distance and Collision Detection

Closest Point Query Among The Union Of Convex Polytopes Using Rasterization Hardware

Fast Penetration Depth Computation Using Rasterization Hardware and Hierarchical Refinement

VIII. Visibility algorithms (II)

Collision Detection between Dynamic Rigid Objects and Static Displacement Mapped Surfaces in Computer Games

A specialised collision detector for grape vines

An efficient space partitioning technique based on linear kd-trees for simulation of short-range interactions in particle methods

An efficient space partitioning technique based on linear kd-trees for collision culling

Advanced Ray Tracing

3D Modeling: Solid Models

CMSC 425: Lecture 10 Geometric Data Structures for Games: Index Structures Tuesday, Feb 26, 2013

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Fall, 2012

Six-Degree-of-Freedom Haptic Rendering Using Incremental and Localized Computations

1 Introduction. 1.1 Main Contributions

11 - Spatial Data Structures

Topics. Ray Tracing II. Intersecting transformed objects. Transforming objects

Collision Detection Algorithms for Motion Planning

Introduction to 2D and 3D Computer Graphics. Realistic Rendering. -- Solids Modeling --

Interactive and Exact Collision Detection for. Multi-Body Environments. Naval Postgraduate School.

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

Ray Tracing with Spatial Hierarchies. Jeff Mahovsky & Brian Wyvill CSC 305

Acceleration Structures. CS 6965 Fall 2011

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Spatial data structures in 2D

9. Three Dimensional Object Representations

Zonotopes as Bounding Volumes

Computer Graphics. Bing-Yu Chen National Taiwan University

Critique for CS 448B: Topics in Modeling The Voronoi-clip Collision Detection Algorithm

Kinetic BV Hierarchies and Collision Detection

The Construction of Balanced Bounding-Volume Hierarchies using Spatial Object Median Splitting Method for Collision Detection

Topics. Ray Tracing II. Transforming objects. Intersecting transformed objects

Transcription:

Collision and Proximity Queries Dinesh Manocha (based on slides from Ming Lin) COMP790-058 Fall 2013

Geometric Proximity Queries l Given two object, how would you check: If they intersect with each other while moving? If they do not interpenetrate each other, how far are they apart? If they overlap, how much is the amount of penetration

Collision Detection Update configurations w/ TXF matrices Check for edge-edge intersection in 2D (Check for edge-face intersection in 3D) Check every point of A inside of B & every point of B inside of A Check for pair-wise edge-edge intersections Imagine larger input size: N = 1000+

Classes of Objects & Problems 2D vs. 3D Convex vs. Non-Convex Polygonal vs. Non-Polygonal Open surfaces vs. Closed volumes Geometric vs. Volumetric Rigid vs. Non-rigid (deformable/flexible) Pairwise vs. Multiple (N-Body) CSG vs. B-Rep Static vs. Dynamic And so on This may include other geometric representation schemata, etc.

Some Possible Approaches Geometric methods Algebraic Techniques Hierarchical Bounding Volumes Spatial Partitioning Others (e.g. optimization)

Voronoi Diagrams l Given a set S of n points in R 2, for each point p i in S, there is the set of points (x, y) in the plane that are closer to p i than any other point in S, called Voronoi polygons. The collection of n Voronoi polygons given the n points in the set S is the "Voronoi diagram", Vor(S), of the point set S. Intuition: To partition the plane into regions, each of these is the set of points that are closer to a point p i in S than any other. The partition is based on the set of closest points, e.g. bisectors that have 2 or 3 closest points.

Generalized Voronoi Diagrams l The extension of the Voronoi diagram to higher dimensional features (such as edges and facets, instead of points); i.e. the set of points closest to a feature, e.g. that of a polyhedron. l FACTS: In general, the generalized Voronoi diagram has quadratic surface boundaries in it. If the polyhedron is convex, then its generalized Voronoi diagram has planar boundaries. M. C. Lin

Voronoi Regions l A Voronoi region associated with a feature is a set of points that are closer to that feature than any other. l FACTS: The Voronoi regions form a partition of space outside of the polyhedron according to the closest feature. The collection of Voronoi regions of each polyhedron is the generalized Voronoi diagram of the polyhedron. The generalized Voronoi diagram of a convex polyhedron has linear size and consists of polyhedral regions. And, all Voronoi regions are convex. M. C. Lin

Simple 2D Example P2 B P1 A Objects A & B and their Voronoi regions: P1 and P2 are the pair of closest points between A and B. Note P1 and P2 lie within the Voronoi regions of each other. M. C. Lin

Basic Idea for Voronoi Marching M. C. Lin

Linear Programming In general, a d-dimensional linear program-ming (or linear optimization) problem may be posed as follows: l Given a finite set A in R d l For each a in A, a constant K a in R, c in R d l Find x in R d which minimize <x, c> l Subject to <a, x> K a, for all a in A. where <*, *> is standard inner product in R d. M. C. Lin

LP for Collision Detection Given two finite sets A, B in R d For each a in A and b in B, Find x in R d which minimize whatever Subject to <a, x> > 0, for all a in A And <b, x> < 0, for all b in B where d = 2 (or 3). M. C. Lin

Minkowski Sums/Differences l Minkowski Sum (A, B) = { a + b a A, b B } l Minkowski Diff (A, B) = { a - b a A, b B } l A and B collide iff Minkowski Difference(A,B) contains the point 0. M. C. Lin

Some Minkowski Differences A B A B M. C. Lin

Minkowski Difference & Translation l Minkowski-Diff(Trans(A, t 1 ), Trans(B, t 2 )) = Trans(Minkowski-Diff(A,B), t 1 - t 2 ) Trans(A, t 1 ) and Trans(B, t 2 ) intersect iff Minkowski-Diff(A,B) contains point (t 2 - t 1 ). M. C. Lin

Properties l Distance distance(a,b) = min a A, b B a - b 2 distance(a,b) = min c Minkowski-Diff(A,B) c 2 if A and B disjoint, c is a point on boundary of Minkowski difference l Penetration Depth pd(a,b) = min{ t 2 A Translated(B,t) = } pd(a,b) = min t Minkowski-Diff(A,B) t 2 if A and B intersect, t is a point on boundary of Minkowski difference M. C. Lin

GJK for Computing Distance between Convex Polyhedra GJK-DistanceToOrigin ( P ) // dimension is m 1. Initialize P 0 with m+1 or fewer points. 2. k = 0 3. while (TRUE) { 4. if origin is within CH( P k ), return 0 5. else { 6. find x CH(P k ) closest to origin, and S k P k s.t. x CH(S k ) 7. see if any point p -x in P more extremal in direction -x 8. if no such point is found, return x 9. else { 10. P k+1 = S k {p -x } 11. k = k + 1 12. } 13. } 14. } M. C. Lin

Large, Dynamic Environments l For dynamic simulation where the velocity and acceleration of all objects are known at each step, use the scheduling scheme (implemented as heap) to prioritize critical events to be processed. l Each object pair is tagged with the estimated time to next collision. Then, each pair of objects is processed accordingly. The heap is updated when a collision occurs. M. C. Lin

Collide System Architecture Transform Sweep & Prune Overlap Simulation Exact Collision Detection Parameters Analysis & Response Collision

Sweep and Prune l Compute the axis-aligned bounding box (fixed vs. dynamic) for each object l Dimension Reduction by projecting boxes onto each x, y, z- axis l Sort the endpoints and find overlapping intervals l Possible collision -- only if projected intervals overlap in all 3 dimensions M. C. Lin

Sweep & Prune T = 1 e 3 e 2 b 3 e 1 b 2 b 1 b 2 e 1 e 2 b 3 e 3 b 1 T = 2 e 2 e 1 b 2 e 3 b 1 b 1 b 2 e 1 e 2 b 3 e 3 b 3 M. C. Lin

Updating Bounding Boxes l Coherence (greedy algorithm) l Convexity properties (geometric properties of convex polytopes) l Nearly constant time, if the motion is relatively small M. C. Lin

Collision and Proximity Queries Dinesh Manocha (based on slides from Ming Lin)

Methods for General Models l Decompose into convex pieces, and take minimum over all pairs of pieces: Optimal (minimal) model decomposition is NP-hard. Approximation algorithms exist for closed solids, but what about a list of triangles? l Collection of triangles/polygons: n*m pairs of triangles - brute force expensive Hierarchical representations used to accelerate minimum finding

Hierarchical Representations l Two Common Types: Bounding volume hierarchies trees of spheres, ellipses, cubes, axis-aligned bounding boxes (AABBs), oriented bounding boxes (OBBs), K-dop, SSV, etc. Spatial decomposition - BSP, K-d trees, octrees, MSP tree, R- trees, grids/cells, space-time bounds, etc. l Do very well in rejection tests, when objects are far apart l Performance may slow down, when the two objects are in close proximity and can have multiple contacts

BVH vs. Spatial Partitioning BVH: SP: - Object centric - Space centric - Spatial redundancy - Object redundancy

BVH vs. Spatial Partitioning BVH: SP: - Object centric - Space centric - Spatial redundancy - Object redundancy

BVH vs. Spatial Partitioning BVH: SP: - Object centric - Space centric - Spatial redundancy - Object redundancy

BVH vs. Spatial Partitioning BVH: SP: - Object centric - Space centric - Spatial redundancy - Object redundancy

Spatial Data Structures & Subdivision Uniform Spatial Sub Quadtree/Octree kd-tree BSP-tree

Uniform Spatial Subdivision l Decompose the objects (the entire simulated environment) into identical cells arranged in a fixed, regular grids (equal size boxes or voxels) l To represent an object, only need to decide which cells are occupied. To perform collision detection, check if any cell is occupied by two object l Storage: to represent an object at resolution of n voxels per dimension requires upto n 3 cells l Accuracy: solids can only be approximated

Bounding Volume Hierarchies l Model Hierarchy: each node has a simple volume that bounds a set of triangles children contain volumes that each bound a different portion of the parent s triangles The leaves of the hierarchy usually contain individual triangles l A binary bounding volume hierarchy:

Type of Bounding Volumes l Spheres l Ellipsoids l Axis-Aligned Bounding Boxes (AABB) l Oriented Bounding Boxes (OBBs) l Convex Hulls l k-discrete Orientation Polytopes (k-dop) l Spherical Shells l Swept-Sphere Volumes (SSVs) Point Swetp Spheres (PSS) Line Swept Spheres (LSS) Rectangle Swept Spheres (RSS) Triangle Swept Spheres (TSS)

BVH-Based Collision Detection

Collision Detection using BVH 1. Check for collision between two parent nodes (starting from the roots of two given trees) 2. If there is no interference between two parents, 3. Then stop and report no collision 4. Else All children of one parent node are checked against all children of the other node 5. If there is a collision between the children 6. Then If at leave nodes 7. Then report collision 8. Else go to Step 4 9. Else stop and report no collision M. C. Lin

Evaluating Bounding Volume Hierarchies Cost Function: F = N u x C u + N bv x C bv + N p x C p F: total cost function for interference detection N u : no. of bounding volumes updated C u : cost of updating a bounding volume, N bv : no. of bounding volume pair overlap tests C bv : cost of overlap test between 2 BVs N p : no. of primitive pairs tested for interference C p : cost of testing 2 primitives for interference

Designing Bounding Volume Hierarchies The choice governed by these constraints: It should fit the original model as tightly as possible (to lower N bv and N p ) Testing two such volumes for overlap should be as fast as possible (to lower C bv ) It should require the BV updates as infrequently as possible (to lower N u ) M. C. Lin

Observations l Simple primitives (spheres, AABBs, etc.) do very well with respect to the second constraint. But they cannot fit some long skinny primitives tightly. l More complex primitives (minimal ellipsoids, OBBs, etc.) provide tight fits, but checking for overlap between them is relatively expensive. l Cost of BV updates needs to be considered.

Trade-off in Choosing BV s Sphere AABB OBB 6-dop Convex Hull increasing complexity & tightness of fit decreasing cost of (overlap tests + BV update)

Building Hierarchies l Choices of Bounding Volumes cost function & constraints l Top-Down vs. Bottum-up speed vs. fitting l Depth vs. breadth branching factors l Splitting factors where & how