Collision Detection. Overview. Efficient Collision Detection. Collision Detection with Rays: Example. C = nm + (n choose 2)

Similar documents
Rapid Collision Detection by Dynamically Aligned DOP-Trees

R s s f. m y s. SPH3UW Unit 7.3 Spherical Concave Mirrors Page 1 of 12. Notes

Hierarchical clustering for gene expression data analysis

Programming in Fortran 90 : 2017/2018

Machine Learning: Algorithms and Applications

Sorting Review. Sorting. Comparison Sorting. CSE 680 Prof. Roger Crawfis. Assumptions

Accessibility Analysis for the Automatic Contact and Non-contact Inspection on Coordinate Measuring Machines

Range images. Range image registration. Examples of sampling patterns. Range images and range surfaces

CE 221 Data Structures and Algorithms

6.854 Advanced Algorithms Petar Maymounkov Problem Set 11 (November 23, 2005) With: Benjamin Rossman, Oren Weimann, and Pouya Kheradpour

Subspace clustering. Clustering. Fundamental to all clustering techniques is the choice of distance measure between data points;

The Greedy Method. Outline and Reading. Change Money Problem. Greedy Algorithms. Applications of the Greedy Strategy. The Greedy Method Technique

2D Raster Graphics. Integer grid Sequential (left-right, top-down) scan. Computer Graphics

Course Introduction. Algorithm 8/31/2017. COSC 320 Advanced Data Structures and Algorithms. COSC 320 Advanced Data Structures and Algorithms

Model Clipping Triangle Strips and Quad Meshes.

Chapter 4. Non-Uniform Offsetting and Hollowing by Using Biarcs Fitting for Rapid Prototyping Processes

Skew Angle Estimation and Correction of Hand Written, Textual and Large areas of Non-Textual Document Images: A Novel Approach

All-Pairs Shortest Paths. Approximate All-Pairs shortest paths Approximate distance oracles Spanners and Emulators. Uri Zwick Tel Aviv University

Today s Outline. Sorting: The Big Picture. Why Sort? Selection Sort: Idea. Insertion Sort: Idea. Sorting Chapter 7 in Weiss.

Simplification of 3D Meshes

Exercises (Part 4) Introduction to R UCLA/CCPR. John Fox, February 2005

PARTITIONING POSITIONAL AND NORMAL SPACE FOR FAST OCCLUSION DETECTION

Computer Animation and Visualisation. Lecture 4. Rigging / Skinning

CSCI 104 Sorting Algorithms. Mark Redekopp David Kempe

Outline. Discriminative classifiers for image recognition. Where in the World? A nearest neighbor recognition example 4/14/2011. CS 376 Lecture 22 1

Parallel matrix-vector multiplication

Kent State University CS 4/ Design and Analysis of Algorithms. Dept. of Math & Computer Science LECT-16. Dynamic Programming

Problem Set 3 Solutions

Parallelism for Nested Loops with Non-uniform and Flow Dependences

Resolving Ambiguity in Depth Extraction for Motion Capture using Genetic Algorithm

S1 Note. Basis functions.

High-Boost Mesh Filtering for 3-D Shape Enhancement

For instance, ; the five basic number-sets are increasingly more n A B & B A A = B (1)

The Codesign Challenge

Assignment # 2. Farrukh Jabeen Algorithms 510 Assignment #2 Due Date: June 15, 2009.

Sequential search. Building Java Programs Chapter 13. Sequential search. Sequential search

Solving two-person zero-sum game by Matlab

Support Vector Machines

FEATURE EXTRACTION. Dr. K.Vijayarekha. Associate Dean School of Electrical and Electronics Engineering SASTRA University, Thanjavur

ELEC 377 Operating Systems. Week 6 Class 3

Active Contours/Snakes

Design and Analysis of Algorithms

Sorting: The Big Picture. The steps of QuickSort. QuickSort Example. QuickSort Example. QuickSort Example. Recursive Quicksort

Feature Reduction and Selection

Vanishing Hull. Jinhui Hu, Suya You, Ulrich Neumann University of Southern California {jinhuihu,suyay,

LOOP ANALYSIS. The second systematic technique to determine all currents and voltages in a circuit

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

Computer models of motion: Iterative calculations

CSE 326: Data Structures Quicksort Comparison Sorting Bound

GSLM Operations Research II Fall 13/14

A MOVING MESH APPROACH FOR SIMULATION BUDGET ALLOCATION ON CONTINUOUS DOMAINS

such that is accepted of states in , where Finite Automata Lecture 2-1: Regular Languages be an FA. A string is the transition function,

Accounting for the Use of Different Length Scale Factors in x, y and z Directions

Reading. 14. Subdivision curves. Recommended:

Insertion Sort. Divide and Conquer Sorting. Divide and Conquer. Mergesort. Mergesort Example. Auxiliary Array

Accelerating X-Ray data collection using Pyramid Beam ray casting geometries

Line Clipping by Convex and Nonconvex Polyhedra in E 3

Sorting and Algorithm Analysis

PHYSICS-ENHANCED L-SYSTEMS

Helsinki University Of Technology, Systems Analysis Laboratory Mat Independent research projects in applied mathematics (3 cr)

Compiler Design. Spring Register Allocation. Sample Exercises and Solutions. Prof. Pedro C. Diniz

CSE 326: Data Structures Quicksort Comparison Sorting Bound

12/2/2009. Announcements. Parametric / Non-parametric. Case-Based Reasoning. Nearest-Neighbor on Images. Nearest-Neighbor Classification

Cache Performance 3/28/17. Agenda. Cache Abstraction and Metrics. Direct-Mapped Cache: Placement and Access

A Fast Content-Based Multimedia Retrieval Technique Using Compressed Data

Lecture 4: Principal components

Lobachevsky State University of Nizhni Novgorod. Polyhedron. Quick Start Guide

Computing the Minimum Directed Distances Between Convex Polyhedra

3D vector computer graphics

IMPROVING AND EXTENDING THE INFORMATION ON PRINCIPAL COMPONENT ANALYSIS FOR LOCAL NEIGHBORHOODS IN 3D POINT CLOUDS

Detection of an Object by using Principal Component Analysis

Support Vector Machines

Face Recognition University at Buffalo CSE666 Lecture Slides Resources:

An exhaustive error-bounding algorithm for hierarchical radiosity


Analysis of Continuous Beams in General

The Erdős Pósa property for vertex- and edge-disjoint odd cycles in graphs on orientable surfaces

Machine Learning. Topic 6: Clustering

Multiblock method for database generation in finite element programs

Local and Global Accessibility Evaluation with Tool Geometry

A Fast Visual Tracking Algorithm Based on Circle Pixels Matching

Hermite Splines in Lie Groups as Products of Geodesics

(1) The control processes are too complex to analyze by conventional quantitative techniques.

Categories and Subject Descriptors B.7.2 [Integrated Circuits]: Design Aids Verification. General Terms Algorithms

LECTURE : MANIFOLD LEARNING

Machine Learning. Support Vector Machines. (contains material adapted from talks by Constantin F. Aliferis & Ioannis Tsamardinos, and Martin Law)

c 2009 Society for Industrial and Applied Mathematics

An Efficient Background Updating Scheme for Real-time Traffic Monitoring

Array transposition in CUDA shared memory

Sorting. Sorting. Why Sort? Consistent Ordering

y and the total sum of

Boosting Spatial Pruning: On Optimal Pruning of MBRs

A mathematical programming approach to the analysis, design and scheduling of offshore oilfields

TN348: Openlab Module - Colocalization

Graph-based Clustering

Scan Conversion & Shading

Lecture 3: Computer Arithmetic: Multiplication and Division

Multi-Resolution Geometric Fusion

Slide 1 SPH3UW: OPTICS I. Slide 2. Slide 3. Introduction to Mirrors. Light incident on an object

CS434a/541a: Pattern Recognition Prof. Olga Veksler. Lecture 15

Transcription:

Overvew Collson detecton wth Rays Collson detecton usng BSP trees Herarchcal Collson Detecton OBB tree, k-dop tree algorthms Multple object CD system Collson Detecton Fundamental to graphcs, VR applcatons Applcatons nclude anmaton, games, vrtual manufacturng, CAD/CAM flght/vehcle smulators, robotcs, path/moton plannng Termed more generally collson handlng, t conssts of the followng: collson detecton: Do objects collde? (boolean response) collson determnaton: Where exactly s the ntersecton? collson response: What do you do as a result? ITCS 3050:Game Engne Programmng 1 Collson Detecton ITCS 3050:Game Engne Programmng 2 Collson Detecton Effcent Collson Detecton Collson Detecton wth Rays: Example Realtme applcatons demand fast collson detecton. Testng every par of trangles mpossble; wth n statc and m dynamc objects, cost s C = nm + (n choose 2) Herarchcal boundng volume technques can be used to effcently solve collson detecton, In partcular the OBB tree and k-dop tree algorthms can deal wth large numbers of polygons. Can deal wth rgd body moton (rotaton+translaton) Effcent BV fttng, mprovng performance. Imagne a car drvng on a road slopng upwards Could test all trangles of all wheels aganst road geometry For certan applcatons, we can approxmate, and stll get a good result Idea: approxmate a complex object wth a set of rays ITCS 3050:Game Engne Programmng 3 Collson Detecton ITCS 3050:Game Engne Programmng 4 Collson Detecton

Collson Detecton wth Rays: Example Collson Detecton wth Rays (contd) Put a ray at each wheel Compute the closest ntersecton dstance, t, between ray and road geometry = 0, car on the road t > 0, car flyng above road < 0, car ploughng nto road Have smplfed car, but not the road Can use spatal data structures for the road Use BVH or BSP tree, for example The dstance along ray can be negatve Therefore, ether search ray n both postve and negatve drecton Response: move back ray, untl t s outsde the BV of road geometry Use values of t to compute a smple collson response ITCS 3050:Game Engne Programmng 5 Collson Detecton ITCS 3050:Game Engne Programmng 6 Collson Detecton Collson Detecton wth BSP Trees Collson Detecton wth BSP Trees Effcent algorthms exst for performng set operatons (unon, ntersecton, dfference, etc.) wth BSP trees (Thbault/Naylor, SIG- GRAPH 87) Beng a spatal data structure, BSP trees can be used to effcently test for collsons. Collsons are an example of ntersecton wth the geometry represented by BSP trees. Such operatons are also possble wth octrees and other spatal data structures. ITCS 3050:Game Engne Programmng 7 Collson Detecton Assume object movng from p 0 at frame n to to p 1 at frame n + 1. Easy to ntersect ray segments aganst BSP tree; can have multple ntersectons, but the frst ntersecton s needed; front to back orderng s exploted. Easly extended to spheres: shft the plane by radus and test. s shfted to test π : n x + d = 0 π : n x + d ± r = 0 where the sgn of r depends on the space contanng the character. ITCS 3050:Game Engne Programmng 8 Collson Detecton

Collson Detecton wth BSP Trees (contd.) General Herarchcal Collson Detecton Spheres are not approxmate characters very well - convex hull of character or cylnder s better. Add Collson detecton s performed between models represented usng Boundng Volume Herarches (BVH) Hgh level algorthm s the same, regardless of BVH mplementaton Cost functons are used to evaluate and compare performance MAX v S(n (v p 0 )) Computatonally more expensve, as the vertces are projected along n to determne the max shft needed. Usng a cylnder s compromse (see text for detals). ITCS 3050:Game Engne Programmng 9 Collson Detecton ITCS 3050:Game Engne Programmng 10 Collson Detecton Herarchy Constructon(contd) Herarchy Constructon Generally a k-ary tree, where each node has at most k chldren. Bnary trees are the most common Internal nodes contan boundng volumes, denoted A BV, whle leaf nodes contan trangles, denoted A c, where A s any tree node ITCS 3050:Game Engne Programmng 11 Collson Detecton Trees can be bult bottom-up, ncremental nserton, top-down To create effcent, tght structures, the boundng volumes must be of mnmal sze. Methods: Bottom-up Closely located objects clustered and ther BV computed Clusters are joned nto larger clusters, untl we are left wth a sngle cluster (entre scene). BOXTREE (Barquet at al., 1996) Methods: Incremental Inserton Objects nserted one at a tme nto an ntally empty tree Heurstcs used to ensure that nserted object mnmzes ncrease n tree volume Automatc BV Herarchy (Goldsmth 87) for ray tracng. ITCS 3050:Game Engne Programmng 12 Collson Detecton

Herarchy Constructon (contd) Collson Testng Between Herarches Gven A and B are two nodes n the model herarches, A BV, B BV are the respectve BVs, the followng s the general CD testng algorthm: Methods: Top-Down Most common herarchy constructon algorthm Starts wth BV of scene Dvde and conquer to recursvely splt the objects Need to determne a splttng axs, and a splt pont n the axs. Lazy evaluaton possble, but bad dea for real-tme applcatons. Balanced trees vs. more optmal trees ITCS 3050:Game Engne Programmng 13 Collson Detecton ITCS 3050:Game Engne Programmng 14 Collson Detecton Cost Functon Collson Testng Between Herarches: Notes Node wth larger volume s descended; larger boxes generally gve better performance Algorthm performs BV/BV and trangle/trangle tests; can also modfy algorthm to test trngle vs. BV (reduced memory for BVs) Algorthm can be modfed to return all the overlappng pars of trangles (collson determnaton) Cost of collson detecton testng usng BVHs can be quantfed as follows: where n v c v n p c p n u c u t = n v c v + n p c p + n u c u = number of BV/BV overlap tests = cost of a BV/BV overlap test = number of prmtve par overlap tests = cost of a prmtve par overlap test = number of BV updated due to model s moton = cost for updatng a BV ITCS 3050:Game Engne Programmng 15 Collson Detecton ITCS 3050:Game Engne Programmng 16 Collson Detecton

Axs-Alghned Boundng Box Orented Boundng Box (OBB)(Gottschalk 1999) A box whose faces have normals that are all parwse orthogonal, and algned wth the prncpal axes. Defned by extreme ponts, a mn and a max where a mn {x, y, z} a max, ITCS 3050:Game Engne Programmng 17 Collson Detecton Orented Boundng Box: A box whose faces have normals that are all parwse orthogonal, or ts an AABB that s arbtrarly rotated. OBB defned by a center pont, b c and three normalzed normals, b u, b v, b w, wth postve half lengths h B u, h B v, h B w OBBs, because of ther better ft, perform consderably better than spheres or AABB ITCS 3050:Game Engne Programmng 18 Collson Detecton Orented Boundng Box: Creaton Frst the convex hull of the object needs to be computed, results n a set of n trangle vertces, p k, q k, r k, 0 < k < n. Area of trangle k s a k, total area of convex hull s a H = n 1 k=0 ak, centrod of trangle k s m = (p + q + r )/3. Centrod of convex hull s m H = 1 a H n 1 a k m k Compute the covarance matrx C whose egen vectors are the drecton vectors (prncpal drectons) of a good-ft box: [( ) ] 1 n 1 a k C = [c j ] = a H 12 (9mk m k j + p k p k j + q k q k j + r k r k j m H m H j wth 0 <, j < 3 k=0 ITCS 3050:Game Engne Programmng 19 Collson Detecton k=0 Orented Boundng Box Creaton (contd) Once the covarance matrx C s computed, the egen vectors a u, a v, a w are computed and normalzed. Halflengths of the box are determned by projectng the convex hull vertces onto the drecton vectors and fndng the mn/max along each axs. ITCS 3050:Game Engne Programmng 20 Collson Detecton

OBB Tree Algorthm(Gottschalk 1996) OBB/OBB Overlap Test Once the drecton vectors of OBB have been found, then a sequence of separatng axes s determned, 3 each from the normals to the faces of both OBBs, 9 more from the combnatons of edges between the two OBBs. Project vertces from OBB onto separatng axes and test for overlap Detals n Secton 13.12.5 An order of magntude faster wth a new overlap test Reason: One of the OBBs s transformed nto an AABB around orgn. Cost: Transform takes 63 ops, and overlap test may ext after one of the 15 axs tests (axs test range from 17-180 ops) Mght skp the last 9 axs tests, as they tend to cull relatvely small porton of overlaps. ITCS 3050:Game Engne Programmng 21 Collson Detecton ITCS 3050:Game Engne Programmng 22 Collson Detecton OBB Tree Algorthm: Tree Constructon k-dscrete Orentaton Polytope (k-dop) (Kloslowsk 1998) Top down approach Top level OBB s splt along long axs nto two groups, prmtves splt based on ther centrods Can also use the medan to splt prmtves, resultng n balanced trees ITCS 3050:Game Engne Programmng 23 Collson Detecton Convex Polytope defned by k/2 (k s even and usually a small number) normalzed normals (orentatons), n, 1 k/2, wth each n assocated wth two scalar values d mn, d max, wth d mn < d max Each trple (n, d mn, d max ) descrbes a slab, S ITCS 3050:Game Engne Programmng 24 Collson Detecton

k-dscrete Orentaton Polytope (k-dop) k-dop/k-dop Intersecton Test Each slab s the volume between the two planes π m n : n x + d mn π m ax : n x + d max k-dop s the ntersecton of all slabs, S k DOP = 1 l k/2 ITCS 3050:Game Engne Programmng 25 Collson Detecton S l k-dop determned by a small, fxed set of outward k pontng normals. Used as an effcent BV n raytracng (Kay/Kajya 1986) Intersecton test costs k/2 nterval overlap tests. Can be shown for moderate values of k (k = 18) overlap test of two k-dops s an order of magntude faster than two OBBs. AABB: A specal case of a 6-DOP As k ncreases, k-dop resembles the convex hull ITCS 3050:Game Engne Programmng 26 Collson Detecton k-dop/k-dop Intersecton Test Intersecton test s extremely fast, reducton to a 1D nterval overlap problem. To test two k-dops A, B for ntersecton, test all pars of slabs, (S A, S B ) for overlap A one-dmensonal nterval test between d A,mn, d B,max, (1,..., k/2) d B,mn, d A,max Storage: just need to keep k scalars values wth each k-dop and k-dop n Collson Detecton Why k-dop n CD? Faster BV/BV test compared to usng OBB and a tghter ft. Why faster? Orentatons of the k-dop are fxed. When Objects move, k-dop has the added cost of updatng the BV, whle ths s ntegrated nto the OBB/OBB overlap test. k = 18 has been demonstrated to gve good performance n practce (tradeoff between tghter BV and overlap test cost) k = 18, In addton to the 3 normals of AABB, also use sum of ther normals (±1, ±1, 0) k = 26, use AABB normals, plus ((±1, ±1, ±1) ITCS 3050:Game Engne Programmng 27 Collson Detecton ITCS 3050:Game Engne Programmng 28 Collson Detecton

k-dop Tree Constructon Updatng the k-dop Tree due to Moton Uses a bnary tree, generally contans multple prmtves (40 used by Kloslowsk) at leaf nodes, as k-dops are expensve to transform Top Down Approach: Mn Sum: Mnmzes sum of sub-volumes Mn Max: Mnmzes the larger of the 2 sub-volumes Splatter: Project varances of centrods of trangles onto axs; select axs wth largest varance Longest Sde: BV wth longest sde to splt Splatter performs best n collson detecton; usng the mean of the centrods s better than the medan. Classfy trangles based on ther centrods. When an object undergoes rgd moton, ts k-dop s no longer vald and must be updated. Approxmaton Method Transform the orgnal k-dop vertces and then recompute a new k-dop Advantageous, f the number of vertces on the k-dop s smaller than the contaned geometry, but ft can become worse ITCS 3050:Game Engne Programmng 29 Collson Detecton ITCS 3050:Game Engne Programmng 30 Collson Detecton Updatng the k-dop Tree:Hll Clmbng More expensve, requres convex hull of object Local updates are made n each frame, maxmal vertces are tested to see f they are vald, else a nee vertex (neghbor) s chosen to update the k-dop. More expensve, but tghter BV (use hll clmbng at root, and approxmaton method at lower level nodes) ITCS 3050:Game Engne Programmng 31 Collson Detecton