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

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

Spatial Data Structures

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

Spatial Data Structures

Collision Detection based on Spatial Partitioning

Collision and Proximity Queries

Acceleration Data Structures

Intersection Acceleration

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

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

Bounding Volume Hierarchies

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

Spatial Data Structures

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

Spatial Data Structures

Collision Detection with Bounding Volume Hierarchies

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

Ray Tracing Acceleration Data Structures

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

Spatial Data Structures

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

Ray Tracing Acceleration. CS 4620 Lecture 20

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

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

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

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

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

Ray Tracing Acceleration. CS 4620 Lecture 22

Lesson 05. Mid Phase. Collision Detection

Collision handling: detection and response

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

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

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

Dynamic Spatial Partitioning for Real-Time Visibility Determination. Joshua Shagam Computer Science

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

Real-Time Collision Detection for Dynamic Virtual Environments

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

Accelerated Raytracing

Ray Tracing: Intersection

CS535 Fall Department of Computer Science Purdue University

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Acceleration. Welcome!

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

Collision Detection. Pu Jiantao.

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Spatial Data Structures and Acceleration Algorithms

Spatial Data Structures. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

11 - Spatial Data Structures

improving raytracing speed

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

Accelerating Ray Tracing

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

Computer Graphics Ray Casting. Matthias Teschner

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

Ray Genealogy. Raytracing: Performance. Bounding Volumes. Bounding Volume. Acceleration Classification. Acceleration Classification

Geometry proxies (in 2D): a Convex Polygon

COMP 175: Computer Graphics April 11, 2018

Acceleration Data Structures. Michael Doggett Department of Computer Science Lund university

Accelerating Ray-Tracing

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

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

Computer Graphics. - Ray-Tracing II - Hendrik Lensch. Computer Graphics WS07/08 Ray Tracing II

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

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

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

Lecture 2 - Acceleration Structures

Ray Intersection Acceleration

Logistics. CS 586/480 Computer Graphics II. Questions from Last Week? Slide Credits

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

Acceleration Structures. CS 6965 Fall 2011

Solid Modeling. Thomas Funkhouser Princeton University C0S 426, Fall Represent solid interiors of objects

Bounding Volume Hierarchies. CS 6965 Fall 2011

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

ROBOSIM GEOMETRY MODULE RYAN SHELTON. B.S., Kansas State University, 2003 A REPORT. submitted in partial fulfillment of the

Dynamic Collision Detection

CPSC GLOBAL ILLUMINATION

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

Advanced Ray Tracing

VIII. Visibility algorithms (II)

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

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

Ray Intersection Acceleration

Topic 10: Scene Management, Particle Systems and Normal Mapping. CITS4242: Game Design and Multimedia

Kinetic Bounding Volume Hierarchies for Deformable Objects

Questions from Last Week? Extra rays needed for these effects. Shadows Motivation

CS 431/636 Advanced Rendering Techniques

A Survey on Collision Detection Techniques for Virtual Environments

Spatial Data Structures and Acceleration Algorithms

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Space-based Partitioning Data Structures and their Algorithms. Jon Leonard

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13

Principles of Computer Game Design and Implementation. Revision Lecture

EDAN30 Photorealistic Computer Graphics. Seminar 2, Bounding Volume Hierarchy. Magnus Andersson, PhD student

Overview of 3D Object Representations

Kinetic BV Hierarchies and Collision Detection

Collision Detection of Triangle Meshes using GPU

Multidimensional Indexing The R Tree

Holger Dammertz August 10, The Edge Volume Heuristic Robust Triangle Subdivision for Improved BVH Performance Holger Dammertz, Alexander Keller

Graphics 2009/2010, period 1. Lecture 8: ray tracing

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

A Different Approach for Continuous Physics. Vincent ROBERT Physics Programmer at Ubisoft

Transcription:

CPSC 599.86 / 601.86 Sonny Chan - University of Calgary Collision Detection II

Outline Broad phase collision detection: - Problem definition and motivation - Bounding volume hierarchies - Spatial partitioning approaches

Polyhedron Tests

Polyhedron Intersection Tests Segment-Mesh Mesh-Mesh

Brute-Force Approach (etc) Test segment against every primitive: O(n) complexity

Brute-Force Approach (etc) Test every pair of primitives for possible intersection: O(mn) complexity

Too Slow! Haptic rendering requires us to compute collisions within a millisecond time interval Typical meshes have thousands of primitives Collision detection is a search problem - Recall what you learned in CPSC 331 Divide-and-conquer paradigm: - We can accelerate the operation by organizing our geometry into a tree data structure!

Two Approaches Bounding volume hierarchy - Partitions the object itself into smaller chunks that are fit within simple geometric primitives Spatial subdivision - Partitions the underlying space the object sits in

Spatial Partitioning Most direct extension of a binary search tree to three (or more!) dimensions Partitioning is more flexible, and can cake different forms: - Spatial hash (not really a tree) - Quadtree / octree - k-dimensional (k-d) tree - Binary space partition (BSP) tree

A Few Examples...

Spatial Hashing

Spatial Hashing Extremely easy to implement Can provide constant time collision queries in the ideal case How do we decide what the grid spacing should be?

What about our other friend?

Spatial Hashing Limitations

Quadtree / Octree

Quadtree / Octree Very simple to implement Does not make any effort to partition the space efficiently Has a high branching factor Can be efficient when data is uniform

k-dimensional Tree

k-dimensional Trees Binary tree that partitions space along an axis-aligned plane Adaptive to the characteristics of the input geometry (more balanced tree) Many partitioning heuristics for construction: - Alternating x-y-z axes - Equal count vs. equal volume

Searching a k-d Tree 1 4 2 3

What About a Segment????

Binary Space Partition Tree

Binary Space Partition Tree Allows splitting along arbitrary plane Fewer objects or primitives are split in the middle Can require more effort to construct Slightly more storage overhead than a k-d tree

Spatial Partitioning Summary Different partitioning structures are embodiments of the same principle Supports O(log n) time query for a point and expected logarithmic time for a ray or segment Choose which one to use based on the characteristics of the geometry

The (Second) Task at Hand How do we detect collision between two complex meshes?

Bounding Volume Hierarchies Similar idea to spatial partitioning, but break up the object instead Takes advantage of spatial coherence When objects collide, the contact set is generally small relative to the mesh size

Bounding Volume Hierarchies Many flavours: - Bounding spheres - Axis-aligned box - Oriented box - Polytope / convex hull Allows mesh collision detection using one common algorithm

BVH Collision Queries Rejection test: If bounding volumes do not intersect, then the objects (or parts within) cannot intersect If bounding volumes intersect, recursively query all pairs of bounding volumes at the next hierarchy level in each object Can track and report an (approximate) minimum separation distance, or simply report interference

Example: Bounding Spheres One large sphere surrounds the mesh Geometry within is partitioned into two parts The structure is recursive: spheres enclose sub-parts Leaf spheres contain one triangle, a few elements, or a small convex component [from D. Ruspini et al., Proc. ACM SIGGRAPH, 1997.]

Bounding Sphere Construction Easiest intersection test in the book, but... How do we determine the bounding sphere? How do we partition the object geometry?

Bounding Sphere Construction Building the tree is expensive and often done as an offline preprocessing step If you have all the time in the world... - Try every possible partition - Compute the tightest bounding sphere In practice, heuristics are used for partitioning and a good enough bounding sphere is computed

Axis-Aligned Bounding Box Intersection test is just as easy as spheres... but parititioning and bounding is much easier!

AABB Collision Detection So why doesn t everyone just use axis-aligned bounding boxes?

Rotation Dependent! =

Oriented Bounding Boxes Tighter fit than spheres, axis-aligned boxes How would you orient the box? AABB OBB

Discrete Oriented Polytopes An even tighter fit than oriented boxes AABB OBB 8-DOP How would you do an intersection test?

Types of Bounding Volumes Many shapes (primitives) can be used as bounding volumes Choice of bounding volume has computational efficiency tradeoffs Sphere AABB OBB k-dop Convex Hull

Bounding Volumes Summary Carefully crafted BVHs can facilitate fast mesh-mesh collision detection Choose the best variant for your geometry What is the algorithm s time complexity... - for typical queries? - in the worst case? What are the implications for their use in haptic rendering?

Summary Explored methods for mesh collision queries: - Spatial partitioning methods for segments - Bounding volume hierarchies for meshs Do they still work for deformable objects?