PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.

Slides:



Advertisements
Similar presentations
Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Advertisements

Nearest Neighbor Search

Spatial Data Structures Hanan Samet Computer Science Department
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.
Searching on Multi-Dimensional Data
CSE 381 – Advanced Game Programming Scene Management
2.8. B INARY S PACE P ARTITIONING T REES Exploration of BSP trees.
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Space Partitioning for Broad Sweep Collision Detection Part 2 - Quadtrees Game Design Experience Professor Jim Whitehead February 13, 2009 Creative Commons.
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
2-dimensional indexing structure
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.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
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.
Efficient Distance Computation between Non-Convex Objects by Sean Quinlan presented by Teresa Miller CS 326 – Motion Planning Class.
R-Trees 2-dimensional indexing structure. R-trees 2-dimensional version of the B-tree: B-tree of maximum degree 8; degree between 3 and 8 Internal nodes.
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.
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.
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.
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.
CS 450: COMPUTER GRAPHICS VISIBLE SURFACE DETECTION SPRING 2015 DR. MICHAEL J. REALE.
Trees for spatial data representation and searching
10/09/2001CS 638, Fall 2001 Today Spatial Data Structures –Why care? –Octrees/Quadtrees –Kd-trees.
Collision handling: detection and response
Graphics Graphics Korea University cgvr.korea.ac.kr Solid Modeling 고려대학교 컴퓨터 그래픽스 연구실.
Week 13 - Monday.  What did we talk about last time?  Exam 2!  Before that…  Polygonal techniques ▪ Tessellation and triangulation  Triangle strips,
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Multi-dimensional Search Trees
12/4/2001CS 638, Fall 2001 Today Managing large numbers of objects Some special cases.
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.
11/20/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Collision Detection Overview Player-Environment handling.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
Presented by Paul Phipps
Maths & Technologies for Games Spatial Partitioning 2
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Advanced Computer Graphics Spring 2009 K. H. Ko Department of Mechatronics Gwangju Institute of Science and Technology.
Ray Tracing Optimizations
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Ray Tracing Acceleration (3)
Hierarchical Data Structure in Game Programming Yanci Zhang Game Programming Practice.
CS552: Computer Graphics Lecture 28: Solid Modeling.

Bounding Volume Hierarchies and Spatial Partitioning
Collision Detection Spring 2004.
Bounding Volume Hierarchies and Spatial Partitioning
Modeliranje kompleksnih modelov
Mean Shift Segmentation
KD Tree A binary search tree where every node is a
Orthogonal Range Searching and Kd-Trees
Collision handling: detection and response
Quadtrees 1.
CS679 - Fall Copyright Univ. of Wisconsin
Collision Detection.
Modeliranje kompleksnih modelov
Presentation transcript:

PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection

Collision Detection – Motivation Essential within varying accuracy bounds and various contexts for a lot of applications

Collision Handling Collision Detection Collision Determination Response State Update View Response

Collision Detection Between two objects (Narrow phase/Pair processing)‏ Between multiple objects – Broad phase/N-body processing Identify smaller groups of objects that maybe colliding and exclude those that are definitely not colliding – Narrow phase/Pair processing Pair-wise tests for collision within smaller sub-groups

Collision Detection Algorithms – Overview Narrow phase algorithms – Ray intersection – Bounding box/Bounding circle – Separating axis theorem – Sweep tests Broad phase algorithms – Bounding volume hierarchy – Spatial Partitioning Grids Trees – Binary space partitioning – Quad trees

Ray Intersection PAIRWISE COLLISION DETECTION

Ray Intersection Dot Product V 1 -Velocity of ball. P- Plane, r- radius of ball Distance traveled towards plane (direction opposite to normal) in time (t)= t*dot(V 1, Normal)‏ Compute 't' based on the distance to plane. Then, Position of collision will be ball's center + t*V 1 V1V1 P Normal

Ray intersection(contd.)‏

Did we hit the polygon ?

Did we hit the polygon? Not necessarily. We might have hit the plane and not the polygon. (180/PI)* (acos(dot(L1,L2)) +acos( dot(L2, L3)) + acos(dot(L3, L1))) = 180

Sphere-Plane P r L' L

Sphere-plane L= (N: Normal, D: distance from origin)‏ N.P + D = r N.P + D – r = 0 L' =

Sphere-Sphere Sphere with center at C 1 and radius r 1 Sphere with center at C 2 and radius r 2 Collision occurs when |C 1 -C 2 | = r 1 + r 2

Space Partitioning BROAD PHASE PARTITIONING

Space Partitioning Provide broad phase processing by dividing the space into regions and testing if objects overlap the same region of space Methods using – Grids – Trees

Spatial Partitioning – OcTrees & QuadTrees Axis-aligned hierarchical partitioning – OcTree – A volume of 3D world space – QuadTree – An area of 2D world space Tree structure – Parent node has eight/four children and an associated bounding volume/area – Child nodes are created by sub-dividing the volume/area into eight/four smaller equal size sub-cubes/sub-squares by dividing into half along each of the three/two axes – Root node volume/area is generally the smallest axis aligned cube/square that encloses the entire world OcTree Volume sub-division

Spatial Partitioning – OcTrees & QuadTrees Static tree or dynamic tree Tree creation – – Top down approach Start with all primitives associated with the root node Recursively split the node volume/area and reassign the primitives to the child nodes Determining which child a primitive belongs to – – Divide the primitives using a X partitioning plane/line then further divide the divisions using the Y partitioning and the using the Z partitioning (in case of OcTrees)‏ – For each child node and each primitive a full AABB overlap test is performed – Expensive Handling overlapping primitives – – Duplicate the primitives in the overlapping volumes/areas – Restrict the placement of primitives to the lowest node that contains the primitive – Used in dynamic trees

Spatial Partitioning – OcTrees & QuadTrees Tree creation – – Incremental approach – Suitable for dynamic trees Start with a root node, and add primitives into this node Split the node into child nodes when the number of primitives in the node increase above a certain limit Testing a dynamic tree for collisions – Recursive top-down procedure in which the objects for each non-empty node are checked against all objects in the sub-tree below that node

Spatial Partitioning – OcTrees & QuadTrees Loose Trees – To solve the problem of small objects getting stuck high up in the tree due to overlap, the node volumes are expanded by some amount to make them partially overlapping – Assuming spherical objects, the objects are propagated into the child node in which the sphere center is contained – Objects descend deeper into the tree – Another benefit, the depth at which an object is to be inserted can be computed from the size of the object

Spatial Partitioning – k-dimensional Trees Generalization of OcTrees and QuadTrees k – Number of dimensions subdivided Instead of simultaneously dividing space in multiple dimensions, the k-d tree divides space along one dimension at a time Advantage – Simpler code for tree operations Other applications – Location of a point in a regions, Nearest neighbors, Locate all points in a given region

Binary Space-Partitioning Tree Binary tree structure that recursively partitions space into pairs of subspaces with respect to dividing planes of arbitrary position and orientation. If the space being partitioned is n-dimensional, the dividing planes are (n − 1)-dimensional hyperplanes The two partitions into which the space is divided into are referred to as the positive and negative halfspaces. The positive halfspace lies in front of the dividing hyperplane and the negative halfspace behind it. f

Binary Space-Partitioning Tree Types of BSP trees based on partitioning planes – – Auto-partitioning/Polygon aligned – Dividing planes coincide with faces of geometry – Axis aligned i.e. k-d trees – Dividing places are aligned with the XY, YZ or XZ planes – Arbitrary/General – No restrictions of dividing planes Spatial Partitioning Volume/Boundary representation

Binary Space-Partitioning Tree Leaf-storing BSP trees – Geometry is stored in leaves of the tree – Internal nodes only store the dividing planes and the references to the child nodes – Collision queries perform tests on all polygons contained in the leaves overlapped by the query object

Binary Space-Partitioning Tree Solid Leaf BSP Trees – Represent the solid volume occupied by the input geometry i.e. the dividing planes are selected to separate the solid volume from the exterior of the object – No actual geometry is stored in the nodes – The tree partitions the input volume into a collection of convex polyhedra, which are then represented as the intersection volume of a number of halfspaces – The structure of the tree allows trivial detection of collision i.e. intersection tests directly report whether an object lies in solid or empty space

Thank You