Collision Detection with Bounding Volume Hierarchies

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

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

Bounding Volume Hierarchies

Collision and Proximity Queries

Lesson 05. Mid Phase. Collision Detection

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

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

Real-Time Collision Detection for Dynamic Virtual Environments

Collision Detection based on Spatial Partitioning

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

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

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

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

Efficient Collision Detection Using a Dual Bounding Volume Hierarchy

Intersection Acceleration

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

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

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

Dynamic Collision Detection

Computer Graphics Ray Casting. Matthias Teschner

Collision Detection. Pu Jiantao.

Technical Section. Tribox bounds for three-dimensional objects

Comparing Sphere-Tree Generators and Hierarchy Updates for Deformable Objects Collision Detection

Real-time Continuous Collision Detection and Penetration Depth Computation

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

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

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

1 Introduction. 1.1 Main Contributions

SCALABLE PARALLEL COLLISION DETECTION SIMULATION

Exact distance computation for deformable objects

Accurate and Fast Proximity Queries Between Polyhedra Using Convex Surface Decomposition

Motivation. Culling Don t draw what you can t see! What can t we see? Low-level Culling

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

Deformable Proximity Queries and their Application in Mobile Manipulation Planning

Virtual Reality in Assembly Simulation

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

Efficient Updates of Bounding Sphere Hierarchies for Geometrically Deformable Models

GI-COLLIDE Collision Detection with Geometry Images

COLLISION DETECTION FOR VIRTUAL PROTOTYPING ENVIRONMENTS

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

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

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

Spatial Data Structures

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg

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

Fast Proximity Computation among Deformable Models Using Discrete Voronoi Diagrams

Multi-Core Collision Detection between Deformable Models

Fast continuous collision detection among deformable Models using graphics processors CS-525 Presentation Presented by Harish

Efficient Collision Detection Using Bounding Volume Hierarchies of k-dops Λ

CLODs: Dual Hierarchies for Multiresolution Collision Detection

Spatial Data Structures

RACBVHs: Random Accessible Compressed Bounding Volume Hierarchies

An Adaptive Collision Detection and Resolution for Deformable Objects Using Spherical Implicit Surface

A Fast Method for Local Penetration Depth Computation. Stephane Redon and Ming C. Lin

Deformable and Fracturing Objects

GPU-based Image-space Approach to Collision Detection among Closed Objects

C 2 A: Controlled Conservative Advancement for Continuous Collision Detection of Polygonal Models

Minimum Bounding Boxes for Regular Cross-Polytopes

Fast Computation of Tight Fitting Oriented Bounding Boxes

Acceleration Data Structures

Hierarchy Accelerated Stochastic Collision Detection

REAL TIME COLLISION DETECTION FOR COMPLEX SIMULATIONS BASED ON HYBRID MULTI RESOLUTION APPROXIMATION OF CAD MODELS

Detecting Collisions in Graph-Driven Motion Synthesis

A specialised collision detector for grape vines

CLODs: Dual Hierarchies for Multiresolution Collision Detection

Recall: Inside Triangle Test

BALANCED SPATIAL SUBDIVISION METHOD FOR CONTINUOUS COLLISION DETECTION

Tracking Minimum Distances between Curved Objects with Parametric Surfaces in Real Time

CS535 Fall Department of Computer Science Purdue University

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

Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Efficient Interference Calculation by Tight Bounding Volumes

Adaptive Medial-Axis Approximation for Sphere-Tree Construction

Volumetric Particle Separating Planes for Collision Detection

SURFACE COLLISION DETECTION WITH THE OVERLAPPING BOUNDING BOX BETWEEN VIRTUAL PROTOTYPE MODELS

Efficient Probabilistic Collision Detection for Non-Convex Shapes

Real-Time Collision Detection Between Cloth And Skinned Avatars. Using OBB

Kinetic Bounding Volume Hierarchies for Deformable Objects

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report

Fast Projected Area Computation for Three-Dimensional Bounding Boxes

Speeding up your game

Advanced Computer Graphics Transformations. Matthias Teschner

A Survey on Collision Detection Techniques for Virtual Environments

Exploiting Local Orientation Similarity for Efficient Ray Traversal of Hair and Fur

Accelerated Proximity Queries Between Convex Polyhedra By Multi-Level Voronoi Marching

Consistent Penetration Depth Estimation for Deformable Collision Response

Enhancing Bounding Volumes using Support Plane Mappings for Collision Detection

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

Mathematical Approaches for Collision Detection in Fundamental Game Objects

improving raytracing speed

Continuous Collision Detection for Adaptive Simulations of Articulated Bodies

Fast tetrahedron-tetrahedron overlap algorithm

Detection of Collisions and Self-collisions Using Image-space Techniques

Adaptive Bounding Volume Hierarchies For Deformable Surface Models. Master of Science Thesis in Complex Adaptive Systems FADI BITAR

Software Structures for Virtual Environments

Spatial Data Structures and Acceleration Algorithms

Optimized Continuous Collision Detection for Deformable Triangle Meshes

Simulation (last lecture and this one)

RACBVHs: Random-Accessible Compressed Bounding Volume Hierarchies

Real-time Bounding Box Area Computation

Transcription:

Simulation in Computer Graphics Collision Detection with Bounding Volume Hierarchies Matthias Teschner Computer Science Department University of Freiburg

Outline introduction bounding volumes BV hierarchies of bounding volumes BVH generation and update of BVs design issues of BVHs performance BVHs for deformable objects University of Freiburg Computer Science Department Computer Graphics - 2

Motivation detection of interpenetrating objects object representations in simulation environments do not consider impenetrability aspects polygonal, non-polygonal surface convex, non-convex defined volume (closed surface), undefined volume rigid, deformable pair-wise tests, multiple objects first contact, all contacts intersection, penetration depth, proximity static, dynamic discrete simulation time, continuous time University of Freiburg Computer Science Department Computer Graphics - 3

Example collision detection is an essential part of physically realistic dynamic simulations for each time step compute dynamics detect collisions resolve collisions UNC, Univ of Iowa University of Freiburg Computer Science Department Computer Graphics - 4

Applications surgery planning dysfunction of the hip joint due to reoriented femoral head simulation of range of motion using triangulated surface representations craniofacial surgery planning planning of osteotomies and bone realignment University of Freiburg Computer Science Department Computer Graphics - 5

Applications robotics task planning for multiple robots in a virtual environment continuous time to avoid collisions with small structures time-critical in case of a break-down investigated in the context of product assembly since 1979 Stanford University of Freiburg Computer Science Department Computer Graphics - 6

Applications protein folding design of drug molecules computation of low-energy states considering geometric constraints Stanford University of Freiburg Computer Science Department Computer Graphics - 7

Outline introduction bounding volumes BV hierarchies of bounding volumes BVH generation and update of BVs design issues of BVHs performance BVHs for deformable objects University of Freiburg Computer Science Department Computer Graphics - 8

Motivation collision detection for polygonal models is in simple bounding volumes encapsulating geometrically complex objects can accelerate the detection of collisions no overlapping bounding volumes no collision overlapping bounding volumes objects could interfere University of Freiburg Computer Science Department Computer Graphics - 9

Motivation efficient detection of collision-free state without checking all object primitives overhead for overlapping bounding volumes however, only few bounding volumes overlap in case of multiple objects motivated by spatial coherence for some applications, collision information on the bounding volumes might be sufficient approximate collision detection accuracy depends on the tight fitting of the bounding volume University of Freiburg Computer Science Department Computer Graphics - 10

Examples and Characteristics sphere axis-aligned bounding box desirable characteristics efficient intersection test tight fitting oriented bounding box efficient generation and update in case of object transformation memory-efficient discreteorientation polytope convex hull University of Freiburg Computer Science Department Computer Graphics - 11

Sphere spheres are represented by the center position the radius two spheres do not overlap if University of Freiburg Computer Science Department Computer Graphics - 12

Axis-Aligned Bounding Box AABB AABBs are represented by the center positions the radii, two AABBs in 2D do not overlap if University of Freiburg Computer Science Department Computer Graphics - 13

Discrete-Orientation Polytope k-dop convex polytope whose faces are determined by a fixed set of normals k-dops are represented by k/2 normals k/2 min-max intervals if any pair of intervals does not overlap, k-dops do not overlap University of Freiburg Computer Science Department Computer Graphics - 14

Discrete-Orientation Polytope k-dop also known as fixed-direction hulls FDHs AABB is a 4-DOP. Are all 4-DOPs AABBs? all k-dops share the same pre-defined normal set only min-max intervals are stored per k-dop larger k improves the approximation quality intersection test is more expensive for larger k University of Freiburg Computer Science Department Computer Graphics - 15

Oriented Bounding Box OBB similar to AABB, but with flexible orientations OBBs have not to be aligned with respect to each other or to a coordinate system in contrast to AABBs and k-dops, OBBs can be rotated with an object OBBs are more expensive to check for overlap University of Freiburg Computer Science Department Computer Graphics - 16

OBB Overlap Test in 2D are normalized axes of A and B are radii of A and B is a normalized direction is the distance of centers of A and B A A and B do not overlap in 2D if B University of Freiburg Computer Science Department Computer Graphics - 17

Separating Axis Test motivation two objects A and B are disjoint if for some vector the projections of the objects onto do not overlap. In this case, is a separating axis. if A and B are convex, the separating axis exists if and only if A and B do not overlap A B separating axis for concave objects, a separating axis does not necessarily exist, if both objects are disjoint University of Freiburg Computer Science Department Computer Graphics - 18

Separating Axis Test for polyhedral objects, only a few axes have to be tested axes parallel to face normals of A axes parallel to face normals of B axes parallel to all cross products of edges of A and B in case of 3D OBBs, 3 + 3 + 3 3 axes have to be tested efficient and general overlap test does not provide information on the intersection geometry University of Freiburg Computer Science Department Computer Graphics - 19

OBB Overlapping Test in 3D orientation of B relative to A's basis is the center of B relative to A's coordinate system are the extents of A, B is relative to A's basis, is the same vector relative to B A B vector is a separating axis if University of Freiburg Computer Science Department Computer Graphics - 20

OBB Overlapping Test in 3D 15 axes have to be tested 3 coordinate axes of A's orientation 3 coordinate axes of B's orientation 9 cross products of coordinate axes of both orientations computations of can be simplified, e. g. University of Freiburg Computer Science Department Computer Graphics - 21

Optimal Bounding Volume it depends tight approximation efficient overlap test sphere axis-aligned bounding box oriented bounding box discreteorientation polytope convex hull University of Freiburg Computer Science Department Computer Graphics - 22

Summary - Bounding Volumes simple geometries that encapsulate complex objects efficient overlap rejection test tight object approximation, memory efficient, fast overlap test spheres, AABBs, OBBs, k-dops, convex hulls further BVs, e. g. swept sphere volumes SSVs point-swept sphere PSS line-swept sphere LSS rectangle-swept sphere RSS LSS RSS University of Freiburg Computer Science Department Computer Graphics - 23 UNC

Outline introduction bounding volumes BV hierarchies of bounding volumes BVH generation and update of BVs design issues of BVHs performance BVHs for deformable objects University of Freiburg Computer Science Department Computer Graphics - 24

Bounding Volume Hierarchies efficient overlap rejection test for parts of an objects e. g., object can be subdivided to build a BVH layer 1 layer 2 layer 3 University of Freiburg Computer Science Department Computer Graphics - 25

Data Structure tree of bounding volumes nodes contain BV information leaf nodes contain object primitives BV for parts of the object (layer 2) BV for the entire object (layer 1) BV BV BV BV BV BV for a few/one object primitive(s) primitives primitives primitives University of Freiburg Computer Science Department Computer Graphics - 26

Example Sphere Tree University of Freiburg Computer Science Department Computer Graphics - 27

Example OBB Tree OBB level 1 Object OBBs level n University of Freiburg Computer Science Department Computer Graphics - 28

Overlap Test for BV Trees if BVs in a hierarchy level overlap, their children are checked at a leaf, primitives are checked against BVs and primitives efficient culling of irrelevant object parts University of Freiburg Computer Science Department Computer Graphics - 29

Pseudo Code 1. overlap test for two parent nodes (root) 2. if no overlap then "no collision" else 3. all children of one parent node are checked against children of the other parent node 4. if no overlap then "no collision" else 5. if at leaf nodes then "collision" else go to 3. step 3. checks BVs or object primitives for intersection required tests BV - BV, BV primitive, primitive - primitive University of Freiburg Computer Science Department Computer Graphics - 30

Implementation OBB tree, triangulated object all tests based on separating axis test box-box test 3 + 3 + 3 3 axes have to be tested ( box-triangle test ) not necessarily implemented 3 + 1 (face normals) + 3 3 (cross products of edges) tests triangle-triangle test a) 1 + 1 (face normals) + 3 3 (cross products of edges) tests b) testing each edge of a triangle against the other triangle 6 edge-triangle tests 5 tests sufficient (intersections occur in pairs) University of Freiburg Computer Science Department Computer Graphics - 31

Edge-Triangle Test the edge intersects if University of Freiburg Computer Science Department Computer Graphics - 32

Summary - BVHs (1) Bounding volumes (2) Bounding volume tree Sphere Axis-Aligned Bounding Box (AABB) Object-Oriented Bounding Box (OBB) Discrete-Orientation Polytope (k-dop) (3) Collision detection test University of Freiburg Computer Science Department Computer Graphics - 33

Outline introduction bounding volumes BV hierarchies of bounding volumes BVH generation and update of BVs design issues of BVHs performance BVHs for deformable objects University of Freiburg Computer Science Department Computer Graphics - 34

Sphere start with AABB of all points the center of the sphere is given by the center of the AABB the radius of the sphere is given by the largest distance from the center to a point iteratively improve an initial guess (Ritter 1990) six extremal points of an AABB are computed choose pair of points with largest distance to get the center of the sphere and an initial guess of the radius iteratively enlarge the radius for points outside the sphere minimum bounding sphere (Welzl 1991) randomized algorithm that runs in expected linear time spheres can be translated and rotated with objects University of Freiburg Computer Science Department Computer Graphics - 35

AABB compute six extremal points for the center and the radii AABBs can be translated with an object AABBs cannot be rotated with an object (the overlap test does not work for arbitrarily oriented AABBs) rotation issue is addressed by computing the AABB for the bounding sphere update the AABB only considering the new positions of the original extremal points hill climbing on convex objects or pre-computed convex hulls of concave objects (check adjacent points of the original extremal points to update extremal points) University of Freiburg Computer Science Department Computer Graphics - 36

OBB directions given by eigenvectors of the covariance matrix (PCA) (Barequet 1996) compute an AABB (Barequet 1999) choose two extremal points with the largest distance opposite to each other to define the first direction for the OBB choose two orthogonal directions can be translated and rotated with an object University of Freiburg Computer Science Department Computer Graphics - 37

Outline introduction bounding volumes BV hierarchies of bounding volumes BVH generation and update of BVs design issues of BVHs performance BVHs for deformable objects University of Freiburg Computer Science Department Computer Graphics - 38

Construction of BVHs goals balanced tree tight-fitting bounding volumes minimal redundancy (primitives in more than one BV per level) parameters BV type top-down / bottom-up what and how to subdivide or merge: primitives or BVs how many primitives per leaf in the BV tree re-sampling of the object University of Freiburg Computer Science Department Computer Graphics - 39

Outline introduction bounding volumes BV hierarchies of bounding volumes BVH generation and update of BVs design issues of BVHs performance BVHs for deformable objects University of Freiburg Computer Science Department Computer Graphics - 40

Collision Detection Libraries SOLID RAPID QuickCD Axis-aligned bounding box Object-oriented bounding box k discrete orientation polytope van den Bergen Eindhoven University 1997 Gottschalk et al. University of North Carolina 1995 Klosowski et al. University of New York 1998 University of Freiburg Computer Science Department Computer Graphics - 41

Comparison two spheres with radius 1 and 10000 triangles per sphere computation time 8-DOP OBB ABB distance between sphere centers University of Freiburg Computer Science Department Computer Graphics - 42

Close Proximity in case of close proximity, quality of higher layers influences the collision detection performance quality of lower layers BV approximations is less critical Problem Spheres ABB, k-dop OBB University of Freiburg Computer Science Department Computer Graphics - 43

Outline introduction bounding volumes BV hierarchies of bounding volumes BVH generation and update of BVs design issues of BVHs performance BVHs for deformable objects University of Freiburg Computer Science Department Computer Graphics - 44

Deformable Objects BVH has to be updated in each time step hierarchy generation significantly influences the performance AABBs are commonly used AABBs can be updated efficiently compared to OBBs or spheres AABBs do not optimally approximate an object University of Freiburg Computer Science Department Computer Graphics - 45

Adaptive Hierarchy Update AABB hierarchy initial hierarchy generation during run-time adaptive update bottom-up update starting at layer n/2 object is traversed once to update layer n/2 efficient AABB update by merging AABBs of children update of nodes in layer n/2+1 to n, only if required n/2 Larsson / Akenine-Moeller Eurographics 2001 University of Freiburg Computer Science Department Computer Graphics - 46

Summary introduction bounding volumes BV hierarchies of bounding volumes BVH generation and update of BVs design issues of BVHs performance BVHs for deformable objects University of Freiburg Computer Science Department Computer Graphics - 47

References S. Quinlan, Efficient Distance Computation Between Non-Convex Objects, Proc. Int. Conf. on Robotics and Automation, pp. 3324-3329, 1994. S. Gottschalk, M. C. Lin, D. Manocha, OBBTree: A Hierarchical Structure for Rapid Interference Detection, Proc. SIGGRAPH 96, ACM Computer Graphics, New York, NY, USA, pp. 171-180, 1996. G. van den Bergen, Efficient Collision Detection of Complex Deformable Models using AABB Trees, Journal of Graphics Tools, 2 / 4, pp. 1-13, 1997. J. T. Klosowski et al., Efficient Collision Detection Using Bounding Volume Hierarchies of k-dops, IEEE Trans on Vis and Computer Graphics, 4 / 1, pp. 21-36, 1998. Larsson, Akenine-Moeller, Collision Detection for Continuously Deforming Objects, Proc. Eurographics, 2001. G. van den Bergen, Collision Detection in Interactive 3D Environments, Elsevier, Amsterdam, ISBN: 1-55860-801-X, 2004. C. Ericson, "Real-Time Collision Detection,", Elsevier, Amsterdam, ISBN: 1-55860-732-3, 2005. M. Teschner et al., "Collision Detection for Deformable Objects," Computer Graphics Forum, vol. 24, no. 1, pp. 61-81, March 2005. University of Freiburg Computer Science Department Computer Graphics - 48