David Johnson Cs6360 – Virtual Reality

Slides:



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

Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
CSE 681 Bounding Volumes. CSE 681 Bounding Volumes Use simple volume enclose object(s) tradeoff for rays where there is extra intersection test for object.
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.
Ray Tracing CMSC 635. Basic idea How many intersections?  Pixels  ~10 3 to ~10 7  Rays per Pixel  1 to ~10  Primitives  ~10 to ~10 7  Every ray.
Computational Geometry & Collision detection
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
Review Methods for convex polytopes See video demonstration
Bounding Volume Hierarchy “Efficient Distance Computation Between Non-Convex Objects” Sean Quinlan Stanford, 1994 Presented by Mathieu Brédif.
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.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Continuous Collision Detection David Knott COMP 259 class presentation.
OBBTree: A Hierarchical Structure for Rapid Interference Detection Gottschalk, M. C. Lin and D. ManochaM. C. LinD. Manocha Department of Computer Science,
Bounding Volume Hierarchies and Spatial Partitioning Kenneth E. Hoff III COMP-236 lecture Spring 2000.
Proximity Queries Using Spatial Partitioning & Bounding Volume Hierarchy Dinesh Manocha Department of Computer Science University of North Carolina at.
Apex Point Map for Constant-Time Bounding Plane Approximation Samuli Laine Tero Karras NVIDIA.
Efficient Distance Computation between Non-Convex Objects By Sean Quinlan Presented by Sean Augenstein and Nicolas Lee.
Collision Detection David Johnson Cs6360 – Virtual Reality.
Computer graphics & visualization Collision Detection – Narrow Phase.
Week 13 - Wednesday CS361.
12/4/2001CS 638, Fall 2001 Today Using separating planes/axes for collision testing Collision detection packages.
1 Speeding Up Ray Tracing Images from Virtual Light Field Project ©Slides Anthony Steed 1999 & Mel Slater 2004.
CSE 381 – Advanced Game Programming Quickhull and GJK.
Collision handling: detection and response
Collision Detection & Bounding Boxes 數位內容學院 遊戲開發研究班第一期 3D 圖學 沈育德 Edward Shen May 28, 2005.
Week 13 - Friday.  What did we talk about last time?  Ray/sphere intersection  Ray/box intersection  Slabs method  Line segment/box overlap test.
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,
Collision/Acceleration University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Implementation II.
3D Game Engine Design 1 3D Game Engine Design Ch D MAP LAB.
Computer Game Design and Development
Chapter 11 Collision Detection 가상현실 입문 그래픽스 연구실 민성환.
Advanced Computer Graphics Spring 2009
Presented by Paul Phipps
David Luebke 3/5/2016 Advanced Computer Graphics Lecture 4: Faster Ray Tracing David Luebke
Interactive Continuous Collision Detection for Polygon Soups Xin Huang 11/20/2007.
Minkowski Sums and Distance Computation Eric Larsen COMP
Hierarchical Data Structure in Game Programming Yanci Zhang Game Programming Practice.
Week 13 - Wednesday CS361.
Computer Graphics Implementation II
Bounding Volume Hierarchies and Spatial Partitioning
Chapter 25: Advanced Data Types and New Applications
Collision Detection Spring 2004.
Bounding Volume Hierarchies and Spatial Partitioning
Deformable Collision Detection
Modeliranje kompleksnih modelov
3D Object Representations
Parts of these slides are based on
Collision handling: detection and response
Physics for Games Programmers: Crash Course in Collision Detection
CMSC 635 Ray Tracing.
Implementation II Ed Angel Professor Emeritus of Computer Science
2.5. Basic Primitive Intersection
Motion in Real and Virtual Worlds
Kinetic Collision Detection for Convex Fat Objects
Computer Animation Algorithms and Techniques
Introduction to Computer Graphics with WebGL
Collision Detection.
Deformable Collision Detection
BVH Student: Jack Chang.
Modeliranje kompleksnih modelov
Implementation II Ed Angel Professor Emeritus of Computer Science
GPAT – Chapter 7 Physics.
Presentation transcript:

David Johnson Cs6360 – Virtual Reality Collision Detection David Johnson Cs6360 – Virtual Reality

Basic Problems Too many objects Discrete Sampling Complex Objects

Too Many Objects Even if cheap to detect collisions, will have n^2 checks http://www.youtube.com/watch?v=OBzBfhrjx5s&feature=related

Tunneling

Tunneling

Tunneling

Tunneling

Complex Objects N^2 problem between triangles of individual models

Approaches Too many objects Partition Space Velocity Bounds

Spatial Partition Uniform Grid

Interval Projection Project bounding volume on each axis Maintain sorted lists Possible collision when intervals overlap

Tunneling Fundamentally a sampling problem If you know the max velocity and minimum thickness, can bound the error

Tunneling Fundamentally a sampling problem If you know the max velocity and minimum thickness, can bound the error

Sweep Methods Sweep out the volume along the path Test for collisions Different accuracy choices Test for collisions False positives Bisect the interval Rotations are tough

Time of collision Interval Halving Conservative Advancement Minkowski Difference/ray-cast

Collision for Complex Models Models may have millions of primitives Not moving independently, so sweep methods are overkill Spatial partitions are tough to update May be in close proximity for extended periods Need to avoid false positives

Bounding Volumes Objects are often not colliding Need fast reject for this case Surround with some bounding object Like a sphere Why stop with one layer of rejection testing? Build a bounding volume hierarchy (BVH) A tree

Bounding Volume Hierarchies 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 A binary bounding volume hierarchy:

BVH-Based Collision Detection

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

BV Choices OBB or AABB OBB slightly better for close proximity AABB better for handling deformations

Recursive top-down construction: Building an OBBTree Recursive top-down construction: partition and refit

Building an OBB Tree Given some polygons, consider their vertices...

Building an OBB Tree … and an arbitrary line

Building an OBB Tree Project onto the line Consider variance of distribution on the line

Building an OBB Tree Different line, different variance

Building an OBB Tree Maximum Variance

Building an OBB Tree Minimal Variance

Building an OBB Tree Given by eigenvectors of covariance matrix of coordinates of original points

Building an OBB Tree Choose bounding box oriented this way

Building an OBB Tree Good Box

Building an OBB Tree Add points: worse Box

Building an OBB Tree More points: terrible box

Building an OBB Tree Compute with extremal points only

Building an OBB Tree “Even” distribution: good box

Building an OBB Tree “Uneven” distribution: bad box

Building an OBB Tree Fix: Compute facets of convex hull...

Building an OBB Tree Better: Integrate over facets

Building an OBB Tree … and sample them uniformly

Disjoint bounding volumes: Tree Traversal Disjoint bounding volumes: No possible collision

Tree Traversal Overlapping bounding volumes: split one box into children test children against other box

Tree Traversal

Tree Traversal Hierarchy of tests

Separating Axis Theorem L is a separating axis for OBBs A & B, since A & B become disjoint intervals under projection onto L

Separating Axis Theorem Two polytopes A and B are disjoint iff there exists a separating axis which is: perpendicular to a face from either or perpendicular to an edge from each

Implications of Theorem Given two generic polytopes, each with E edges and F faces, number of candidate axes to test is: 2F + E2 OBBs have only E = 3 distinct edge directions, and only F = 3 distinct face normals. OBBs need at most 15 axis tests. Because edge directions and normals each form orthogonal frames, the axis tests are rather simple.

OBB Overlap Test: An Axis Test h a h b s h + > L is a separating axis iff: a b

OBB Overlap Test: Axis Test Details Box centers project to interval midpoints, so midpoint separation is length of vector T’s image.

OBB Overlap Test: Axis Test Details Half-length of interval is sum of box axis images.

OBB Overlap Test Strengths of this overlap test: 89 to 252 arithmetic operations per box overlap test Simple guard against arithmetic error No special cases for parallel/coincident faces, edges, or vertices No special cases for degenerate boxes No conditioning problems Good candidate for micro-coding

OBB Overlap Tests: Comparison Benchmarks performed on SGI Max Impact, 250 MHz MIPS R4400 CPU, MIPS R4000 FPU

OBBs asymptotically outperform AABBs and spheres Parallel Close Proximity: Experiment Log-log plot Number of BV tests We verify this in the plot of BV tests versus gap size. This log-log plot shows gap size for concentric spheres on the x-axis, and number of BV tests for that configuration -- the experiment was repeated for each BV type. For extremely large gap sizes, on the right, we have a unit size sphere model inside a very large sphere model -- and there is some minimum number of BV tests required to determine non contact. Then, as we reduce the gap size, we start seeing an increase in the number of BV tests needed -- but the rate of increase of the AABB and sphere tests is greater than the rate of increase of the OBB tests. In fact, the slopes are different -- the AABB and sphere slopes are approximately twice that of the OBB slope. On a log-log plot, only monomial functions are straight lines, and the slope is the degree of the monomial. This means the slope -2 of the AABBs and sphere indicates v = O(1/e^2) and the -2 slope for OBBs means v = O(1/e). So indeed, the former is the square of the latter. Gap Size (e) OBBs asymptotically outperform AABBs and spheres

Implementation: RAPID Available at: http://www.cs.unc.edu/~geom/OBB Part of V-COLLIDE: http://www.cs.unc.edu/~geom/V_COLLIDE Thousands of users have ftp’ed the code Used for virtual prototyping, dynamic simulation, robotics & computer animation