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.

Slides:



Advertisements
Similar presentations
Everything you ever wanted to know about collision detection
Advertisements

Two Segments Intersect?
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.
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/
Convex hulls Gift wrapping, d > 2 Problem definition CONVEX HULL, D > 2 INSTANCE. Set S = { p 1, p 2, … p N } of points in d-space (E d ). QUESTION. Construct.
Here is where my object is Here is where my object is going to be Here is where I want my object to be.
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part IV Polygon Intersection.
Advanced Computer Graphics Spring 2014
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
A Fast Algorithm for Incremental Distance Calculation Paper by Ming C. Ling and John F. Canny Presented by Denise Jones.
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
Collision Detection CSE 191A: Seminar on Video Game Programming Lecture 3: Collision Detection UCSD, Spring, 2003 Instructor: Steve Rotenberg.
Half-Space Intersections
UNC Chapel Hill M. C. Lin References Collision Detection between Geometric Models: A Survey, by M. Lin and S. Gottschalk, Proc. of IMA Conference on Mathematics.
Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection  Essential for many games –Shooting –Kicking, punching,
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Oct 3, Fall 2005Game Design1 Collision Detection.
Providing Haptic ‘Hints’ to Automatic Motion Planners Providing Haptic ‘Hints’ to Automatic Motion Planners by Burchan Bayazit Department of Computer Science.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes.
CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”
Exploring Solids. What is a Polyhedron? Polyhedrons Non-Polyhedrons.
Week 13 - Wednesday CS361.
12/4/2001CS 638, Fall 2001 Today Using separating planes/axes for collision testing Collision detection packages.
Prisms Fun with by D. Fisher
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
Vertex – A point at which two or more edges meet Edge – A line segment at which two faces intersect Face – A flat surface Vertices, Edges, Faces.
Collision handling: detection and response
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
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,
Computing the Volume of the Union of Cubes in R 3 Pankaj K. Agarwal Haim Kaplan Micha Sharir.
12/4/2001CS 638, Fall 2001 Today Managing large numbers of objects Some special cases.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
CAP4730: Computational Structures in Computer Graphics
1Computer Graphics Implementation II Lecture 16 John Shearer Culture Lab – space 2
Implementation II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Implementation II.
11/20/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Collision Detection Overview Player-Environment handling.
12.1 Exploring Solids.
Computer Graphics I, Fall 2010 Implementation II.
11-1 Space Figures and Cross Sections Objectives To recognize polyhedra and their parts To visualize cross sections of space figures.
A Fast Algorithm for Incremental Distance Calculation Ming C. Lin and John F. Canny University of California, Berkeley 1991 Original slides by Adit Koolwal.
A Fast Algorithm for Incremental Distance Calculation Ming C. Lin & John Canny University of California, Berkeley 1991 Presentation by Adit Koolwal.
PREPARING FOR SURFACE AREA AND VOLUME DRAWINGS, CROSS SECTIONS AND NETS.
Polygon Triangulation
Solid Shapes. The basics ♥Polygon – 2 space ♥Polyhedron = 3 space ♥Polyhedra or Polyhedrons = plural ♥ A Polyhedron is a closed figure, made up of polygons.
Minkowski Sums and Distance Computation Eric Larsen COMP
Computer Graphics Implementation II
Polyhedra and Prisms.
Collision Detection Spring 2004.
Query Processing in Databases Dr. M. Gavrilova
Algorithm design techniques Dr. M. Gavrilova
Collision handling: detection and response
Planarity and Euler’s Formula
Implementation II Ed Angel Professor Emeritus of Computer Science
I. The Problem of Molding
Computer Animation Algorithms and Techniques
Introduction to Computer Graphics with WebGL
Collision Detection.
11.5 Explore Solids Mrs. vazquez Geometry.
Computational Geometry
Implementation II Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

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 be in continuous motion (vertices are changing) We want to do this stuff FAST!!!

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics2 We’ll only do… Convex polyhedra – Objects will be broken into convex polyhedra or we’ll use an enclosing polyhedron Definition – A line segment joining any two points in the polyhedron is contained in the polyhedron

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics3 Two stage process Bounding boxes – Only test if bounding boxes intersect Witness test – See if we can stick a plane between them

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics4 Bounding box tests We will not even consider O(N 2 ). – Even for something as easy as bounding boxes

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics5 Suppose… You have a set of line segments – [b i,e i ] beginning to end – Bounding boxes in 1D – How could we determine if any overlap? – How fast could I do it?

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics6 Overlap test b1b1 e1e1 b2b2 e2e2 b3b3 e3e3 b4b4 e4e4 b5b5 e5e5 b6b6 e6e6 Any ideas now?

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics7 Overlap test (1D) b1b1 e1e1 b2b2 e2e2 b3b3 e3e3 b4b4 e4e4 b5b5 e5e5 b6b6 e6e6 E  sort(endpoints) O(nlogn) c  0 for each endpoint e  E do O(n) if e is a begin endpoint c  c + 1 else c  c - 1 if c > 1 then output overlapping segments O(k) O(nlogn + k) algorithm Sort and sweep

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics8 Overlap test (3D) We have begin/end combinations for each of 3 dimensions We build three sorted lists – Each dimension Sweep 1 dimension – Sweep 2 nd dimension only for overlaps Sweep 3 rd dimension only for overlaps Algorithm remains O(nlogn + k) Lots of careful “bookkeeping” required. Sometimes called sweep and prune

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics9 Can we do better than O(nlogn)? Algorithmically we can’t – Lower bound But…

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics10 Coherence What will make this work is that things do move very far from frame to frame – Coherence When we update a bounding box, we change the ends – But, usually not be much – Just move it in the list – Expected time: O(n) bingo!!

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics11 So, we have two intersecting bounding boxes, what now? We compare the enclosed polyhedra What defines intersecting polyhedra?

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics12 Intersection definition Two polyhedra A and B do NOT intersect if there exists a plane P such that A and B are on different sides of P – We call this plane a separating plane – It indicates there’s no intersection – Only works for convex polyhedra

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics13 Separating planes Separating planes will either – Contain a face of one of the polyhedra – - or - – Contain the edge of one polyhedra and are parallel to an edge in the other polyhedra

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics14 Determining intersection For every face and every pair of edges – Is this is a separating plane? How do we test for space partitioning?

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics15 Test Let p be any point on P and N be normal to P Dot product of v-p and N will be: – >= 0 for someone on one side – <= 0 for someone on the other side

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics16 Contact determination Can be vertex to plane or edge to edge. We have to again test all pairs

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics17 Fast enough to be any use? Lots of all pairs stuff here. Can this be fast enough to be any use at all? – How often do we call collision detection?

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics18 Witness A witness is some cached value from a previous computation that we can reuse – Keep track of – Previous separating plane Previous collision pair – Why does this make this so fast we’re really impressed?

CSE 872 Dr. Charles B. Owen Advanced Computer Graphics19 Use of witnesses Change from one call to another is very tiny – Separating plane usually does not change Can it? – We are often searching for the collision time – Colliding edges or face/vertex usually do not change Can they?