Chapter 11 Collision Detection 가상현실 입문 2002.6.5 그래픽스 연구실 민성환.

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.
2.3. B OUNDING V OLUMES Bounding volumes of use for collision detection.
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.
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.
고려대학교 그래픽스 연구실 Chapter 6 Collision Detection 6.1~6.4 고려대학교 그래픽스연구실 민성환.
Geometric Representations & Collision Detection Kris Hauser I400/B659: Intelligent Robotics Spring 2014.
Visibility Culling. Back face culling View-frustrum culling Detail culling Occlusion culling.
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.
Algorithmic Robotics and Motion Planning Dan Halperin Tel Aviv University Fall 2006/7 Dynamic Maintenance and Self-Collision Testing for Large Kinematic.
Review Methods for convex polytopes See video demonstration
Collision Detection CSE 191A: Seminar on Video Game Programming Lecture 3: Collision Detection UCSD, Spring, 2003 Instructor: Steve Rotenberg.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
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.
Dynamic Maintenance and Self Collision Testing for Large Kinematic Chains Lotan, Schwarzer, Halperin, Latombe.
OBBTree: A Hierarchical Structure for Rapid Interference Detection Gottschalk, M. C. Lin and D. ManochaM. C. LinD. Manocha Department of Computer Science,
Kinetic Data Structures and their Application in Collision Detection Sean Curtis COMP 768 Oct. 16, 2007.
Bounding Volume Hierarchies and Spatial Partitioning Kenneth E. Hoff III COMP-236 lecture Spring 2000.
Efficient Distance Computation between Non-Convex Objects by Sean Quinlan presented by Teresa Miller CS 326 – Motion Planning Class.
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.
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.
BSP Trees, Quadtrees & Octrees Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, January 28, 2004.
Efficient Maintenance and Self-Collision Testing for Kinematic Chains Itay Lotan Fabian Schwarzer Dan Halperin Jean-Claude Latombe.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
Computer Graphics 2 Lecture x: Acceleration Techniques for Ray-Tracing Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
INTERACTION TECHNIQUES Collision Detection and Other Interactions Collision Detection and Other Interactions.
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
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
Efficient Maintenance and Self- Collision Testing for Kinematic Chains Itay Lotan Fabian Schwarzer Dan Halperin Jean-Claude Latombe.
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.
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.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Advanced Computer Graphics Spring 2009
Presented by Paul Phipps
BSP Tree Supplement Jyun-Ming Chen. Fall Kd-Tree and BSP tree kd-tree is a special kind of bsp tree.
Ray Tracing Optimizations
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.
Bounding Volume Hierarchies and Spatial Partitioning
Distance Computation “Efficient Distance Computation Between Non-Convex Objects” Sean Quinlan Stanford, 1994 Presentation by Julie Letchner.
Collision Detection Spring 2004.
Bounding Volume Hierarchies and Spatial Partitioning
Parts of these slides are based on
Computer Animation Algorithms and Techniques
Collision Detection.
David Johnson Cs6360 – Virtual Reality
Presentation transcript:

Chapter 11 Collision Detection 가상현실 입문 그래픽스 연구실 민성환

2 Collision Detection (CD)  A fundamental and important ingredient in many computer graphics and virtual reality applications  Can be divided into three major parts  Collision detection  Detects whether two objects collide  Collision determination  Finds the actual intersections between a pair objects  Collision response  Determines what actions should be taken in response

3 Content  In section 11.1  We discuss simple and fast CD techniques  Main idea is to approximate a complex object using a set of lines  In section 11.2  Hierarchical bounding volume collision detection algorithm  In section 11.3 and 11.4  Two particular implementations  In section 11.5  A Multiple objects CD system

4 CD System  There are desirable for most CD system  Achieve interactive rates  Handle polygon soup ( general polygon models with no restrictions)  Can undergo rigid-body motion  Provide efficient bounding volume(BV) fitting  A restriction  The methods are static, meaning the collision detection only occurs at discrete times

5 Naive approach  A scenario may contain tens or hundreds of moving objects  If the scenario contains n moving objects and m static objects, then a naïve method would perform Object tests for each frame  The naive approach quickly becomes expensive as m and n rise

6 CD with Rays  A fast technique which works very well under certain circumstance  We can approximate a moving object with a set of rays  Imagine that a car drives upward on an incline road  In the case of the car, we can put one ray at each of the four wheels  The rays are then intersection-tested against the environment –If the distance from a ray origin to the environment is zero  wheel is exactly on the ground –If the distance is greater than zero  no contact with the environment –A negative distance means that the wheel has merged “into” the environment  The application can use these distance for computing a collision response –A negative distance  move the car upward –A positive distance  move the car downward

7 CD with Rays (cont.)  To speed up  Can use the same technique we always use to speed thing up in CG  a hierarchical representation  Environment can be represented by a BSP tree

8 General Hierarchical CD  Hierarchy Building  There are three ways to build a hierarchy  Bottom-up method  Incremental tree-insertion method  Top-down approach method

9 Hierarchy Building (1/3)  Bottom-up method  Starts by combining a number of primitives and finding a BV for them  Then this BV is grouped with one or more BVs constructed a similar way,thus yielding a new, larger parent BV  Repeated until only one BV exists, which then becomes the root

10 Hierarchy Building (2/3)  Incremental tree-insertion method  Starts with an empty tree  Then all other primitives and their BVs are added one at a time  To make an efficient tree, an insertion point in the tree must be found  This point should be selected so that the total tree volume increase is minimized

11 Hierarchy Building (3/3)  Top-down approach  Starts by finding a BV for all primitives of the model  root  Then a divide and conquer strategy is applied  BV is first split into k  For each such part, all included primitives are found, and then a BV is created in the same manner as for the root  A potential advantage is that a hierarchy can be created lazily  This means that we only construct the hierarchy for those parts of the scene where it is actually needed

12 Collision Testing between Hierarchies  Pseudocode  A and B are tow nodes in the model hierarchies FindFirstHitCD(A,B) returns ({TRUE,FALSE}); if (not overlap(A BV,B BV ) return FALSE; else if (isLeaf(A)) if (isLeaf(B)) for each triangle pair T A  A C and T V  B C if (overlap(T A,T B )) return TRUE; else for each child C B  B C FindFirstHitCD(A,C B ) else for each child C A  A C FindFirstHitCD(C A,B) return FALSE

13 Cost Function  It used to evaluate the performance of CD algorithms n v : number of BV/BV overlap tests c v : cost for a BV/BV overlap test n p : number of primitive pairs tested for overlap c p : cost for testing whether two primitives overlap n u : number of BVs updated due to the model’s motion c u : cost for updating a BV

14 OBB Tree  OBB Tree: A Hierarchical Structure for Rapid Interference Detection  At SIGGRAPH 96, Gottschalk et al.  Oriented bounding box  AABB and sphere provide quite poor fits in general ( contain a lot of empty space)  Authors developed a new method for determining whether two OBBs overlap

15 Hierarchy Building  A basic data structure is a binary tree  Internal node holding an OBB  External node (leaf) hoding only one triangle  Top-down approach  A tight-fitting OBB  Can be found by computing an orientation of the triangles of the convex hull  Quickhull algorithm

16 OBB  Denotation  N triangles defined as Δp k q k r k, where p k, q k, and r k are the vertices of triangle k, 0 <= k < n  The area of triangle k as a k  Total area of the convex hull  Centroid of triangles i is m i =(p i +q i +r i )/3  The centroid of the whole convex hull

17 OBB (cont.)  With the use of definitions, we will present a formula that computes a 3X3 covariance matrix  After computing C  The eigenvectors are computed and normalized (direction vectors of OBB)  Find the center and the half-lengths of the OBB  Determine the size and position of the box

18 Split  After we have computed an OBB  The volume and the triangles should be split  Gottschalk et al. use a strategy  Takes the longest axis of the box  Splits it into two parts of the same length

19 Handling Rigid-Body Motions  In the OBBTree hierarchy  Each OBB is stored together with a rigid-body transformation( a rotation matrix R and a translation vector t) matrix M A  This matrix holds the relative orientation and position of the OBB with respect to its parent  Assume that we start to test two OBBs, A and B  The Idea is then to transform B into A’s coordinate system  T AB is decomposed as below  A and B overlap, A’s child called C  Transform B into A’s coordinate and then transform that into the coordinate system of C

20 K-DOPTree  K-DOP  BV/BV overlap test is faster than the OBB  Directions of the planes of the k-DOP are fixed  A tighter fit  As k grows, the k-DOP tends to resemble the convex hull  Tested in order to find a good compromise between the BV tightness and BV/BV overlap cost  6-DOPs(AABBs), 14-DOPs, 18-DOPs, 26-DOPs  K=18 gave the best execution times for several different scenarios

21 Hierarchy Building  K-DOPTree  Also uses a binary tree  The leaves may contain an arbitrary number of triangles  Top-down approach  To splitting the k-DOP into two subvolumes  Four methods have been investigated for selection of one of the main axes, x,y,z –Min Sum : selects the axis that minimizes the sum of the subvolumes –Min Max : selects the axis that minimizes the larger of the two subvolumes –Splatter : computes the variances of the projections of the centroids of the triangles (largest variance) –Longest Side : selects the axis along which the BV is longest

22 Updating the k-DOPTree  Orientations of the planes of the k-DOPs are fixed  A rigid-body motion of an object makes the hierarchy invalid  It must be rebuilt or updated  Klosowski et al. proposed two ways of updating  Approximation method  Avoid recomputing a new k-DOP  Vertex locations at the corners of the original k-DOP are transformed and used  Hill climbing  Require additional storage  At each frame, local updates are made to a new best-fit k-DOP for the geometry

23 A Multiple Objects  A Multiple Objects CD System  Require collision detection between possibly hundreds of pairs of objects  Describe a two-level collision detection system  The first level of this system reports potential collisions among all the objects in environment  Second level performs exact collision detection (previous section)

24 The First-Level CD  A simple approach  Use an AABB  Instead of cubes, spheres can be used  Sweep-and-Prune  Exploit the temporal coherence  If two AABBs overlap  Three one-dimensional intervals in each main axis direction must also overlap

25 Summary  The outline of the collision detection system  First, using the sweep-and-prune algorithm  Second, the object pairs are sent to exact CD algorithms  Finally, the results are forwarded and taken care of by the application (Collision response can be taken) Simulation Pruning Multi- Body Pair Exact Collision Detection (OBBTree&k- DOPTree) Collision Response Object transformation Overlapping pairs Colliding pair