Collision Detection Spring 2004.

Slides:



Advertisements
Similar presentations
Collisions using separating-axis tests
Advertisements

2.6. B OUNDING V OLUME H IERARCHIES Overview of different forms of bounding volume hierarchy.
2.5. B ASIC P RIMITIVE I NTERSECTION Details of common forms of primitive intersection test.
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.
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.
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.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Basic 3D collision detection We want to know if objects have touched Objects are considered to.
Collision Detection CSE 191A: Seminar on Video Game Programming Lecture 3: Collision Detection UCSD, Spring, 2003 Instructor: Steve Rotenberg.
Bounding Volume Hierarchy “Efficient Distance Computation Between Non-Convex Objects” Sean Quinlan Stanford, 1994 Presented by Mathieu Brédif.
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.
Apex Point Map for Constant-Time Bounding Plane Approximation Samuli Laine Tero Karras NVIDIA.
1 Advanced Scene Management System. 2 A tree-based or graph-based representation is good for 3D data management A tree-based or graph-based representation.
Efficient Distance Computation between Non-Convex Objects By Sean Quinlan Presented by Sean Augenstein and Nicolas Lee.
Collision Detection David Johnson Cs6360 – Virtual Reality.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
10/02/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Octrees.
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.
Week 13 - Wednesday CS361.
12/4/2001CS 638, Fall 2001 Today Using separating planes/axes for collision testing Collision detection packages.
INTERACTION TECHNIQUES Collision Detection and Other Interactions Collision Detection and Other Interactions.
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
10/09/2001CS 638, Fall 2001 Today Spatial Data Structures –Why care? –Octrees/Quadtrees –Kd-trees.
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,
CS-378: Game Technology Lecture #10: Spatial Data Structures Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran.
Collision/Acceleration University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
12/4/2001CS 638, Fall 2001 Today Managing large numbers of objects Some special cases.
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
Collaborative Visual Computing Lab Department of Computer Science University of Cape Town Graphics Topics in VR By Shaun Nirenstein.
1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 6, 2002 Day 10.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Chapter 11 Collision Detection 가상현실 입문 그래픽스 연구실 민성환.
Advanced Computer Graphics Spring 2009
Presented by Paul Phipps
Ray Tracing Optimizations
Ray Tracing Acceleration (5). Ray Tracing Acceleration Techniques Too Slow! Uniform grids Spatial hierarchies K-D Octtree BSP Hierarchical grids Hierarchical.
Game Programming 13 Physics in Games (cont.) 2010 년 2 학기 디지털콘텐츠전공.
Hierarchical Data Structure in Game Programming Yanci Zhang Game Programming Practice.
Week 13 - Wednesday CS361.
Bounding Volume Hierarchies and Spatial Partitioning
Lap Chi Lau we will only use slides 4 to 19
Topics in Algorithms Lap Chi Lau.
Bounding Volume Hierarchies and Spatial Partitioning
Deformable Collision Detection
Modeliranje kompleksnih modelov
Parts of these slides are based on
Collision handling: detection and response
Craig Schroeder October 26, 2004
2.5. Basic Primitive Intersection
Motion in Real and Virtual Worlds
INTERACTION TECHNIQUES
CS679 - Fall Copyright Univ. of Wisconsin
Computer Animation Algorithms and Techniques
Collision Detection.
Deformable Collision Detection
BVH Student: Jack Chang.
David Johnson Cs6360 – Virtual Reality
Modeliranje kompleksnih modelov
Presentation transcript:

Collision Detection Spring 2004

Content Classification Types of bounding volumes Discrete, or continuous Types of bounding volumes Bounding volume hierarchy

We talked about … Taxonomy Collision detection Continuous, discrete Collision detection, response Collision detection Particle vs. plane Response and Contact problem Sphere vs. plane (particle vs. offset plane)

Point-Plane Collision Detection x e p v (p: any point on plane) Collision might occur if 1. Close enough and 2. Head toward plane Fall 2014

Point-Plane Collision Response 1/2 x- x+ The projection of x- on the plane Fall 2014

Point-Plane Collision Response 2/2 x v vT vN frictionless CR: Coefficient of Restitution 0  CR  1 Fall 2014

Sphere-Plane Collision x n p v and e Fall 2014

Contact Problem

Types of Bounding Volumes (ref) Sphere Ellipsoid Cylinder OBB (oriented bounding box) AABB (axis-aligned bounding box) K-DOP’s (K-discrete orientation polytopes) Sphere packing Swept sphere volume Spherical shells Convex hull

Types of Bounding Volumes

Oriented Bounding Boxes An oriented bounding box is always smaller (maybe equal to) an axis-aligned bounding box.

Bounding Volumes Hierarchy We used simple geometric entities to bound our polytopes. We keep different levels of bounding volumes in a hierarchy tree.

Bounding Volume Hierarchies So far, we have had subdivisions that break the world into cell General Bounding Volume Hierarchies (BVHs) start with a bounding volume for each object Many possibilities: Spheres, AABBs, OBBs, k-dops, …DOP (discrete oriented polytope) More on these later Parents have a bound that bounds their children’s bounds Typically, parent’s bound is of the same type as the children’s Can use fixed or variable number of children per node No notion of cells in this structure

BVH Example

BVH Construction Top-down: simplest to build Bound everything Choose a split plane (or more), divide objects into sets Recurse on child sets Can also be built incrementally Insert one bound at a time, growing as required Good for environments where things are created dynamically Can also be built bottom-up Bound individual objects, group them into sets, create parent, recurse What’s the hardest part about this?

BVH Operations Some of the operations we’ve looked at so far work with BVHs Frustum culling Collision detection BVHs are good for moving objects Updating the tree is easier than for other methods Incremental construction also helps (don’t need to rebuild the whole tree if something changes) But, BVHs lack some convenient properties For example, not all space is filled, so algorithms that “walk” through cells won’t work

Hierarchical bounding volume AABB OBB Convex polytopes (polyhedra)

Separation of Convex Polytopes H Try to find a hyperplane that separates the two polytopes. A B

Separation of Bounding Boxes l Two boxes do not intersect ↔ there exists a line l such that their projections onto this line do not overlap.

The Separating Axis Theorem The separating axis of two oriented boxes is either perpendicular to one of the faces, or can be obtained as the vector multiplication of two box axes. The interference query between two oriented boxes can be answered by checking 15 axes.

Separating Axis (Vertex-Vertex) u v w L A1 A2 A3 B1 B2 B3 We can show that there exists a vector L such that all three terms have the same sign. Thus:

OBB Intersection Exhaustive search of separation plane

Temporal Coherence

Interference of OBBs Using careful analysis for the various 15 possible axes, it is possible to implement the interference test for two OBBs using about 200 floating-point operations. This method has been implemented and successfully applied to large models.

Problem: Fitting OBBs The OBB fitting problem requires finding the orientation of the box that best fits the data Ideally, you want the minimum volume for the box, but that’s hard Instead, turn to an idea from statistics: principal components Point sample the convex hull of the geometry to be bound Find the mean and covariance matrix of the samples The mean will be the center of the box The eigenvectors of the covariance matrix are the principal directions – they are used for the axes of the box The principal directions tend to align along the longest axis, then the next longest that is orthogonal, and then the other orthogonal axis

OBB (Oriented Bounding Box)

Collision of n Bodies Naïve pairwise comparison: time complexity O(n2) Sweep and prune Sort: O(nlogn) Sweep: O(n) Output: O(k) Further improvement is possible by considering time coherence (later)

Sort/Sweep [one-dimensional]

Coherance-based Method If two intervals i and j overlap at the previous time step, but not at the current time step, one or more exchanges involving either a bi or ei value and a bj or ej value must occur.

Three-Dimensional Cases Can be more complicated Considering AABB: perform 3 one-dimensional tests