Collision Detection And Response Jae Chun KyungSoo Im Chau Vo Hoang Vu.

Slides:



Advertisements
Similar presentations
Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Advertisements

Applications of Integration 6. Volumes Volumes In trying to find the volume of a solid we face the same type of problem as in finding areas. We.
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/
Geometry Primer Lines and rays Planes Spheres Frustums Triangles Polygon Polyhedron.
APPLICATIONS OF INTEGRATION
Three Dimensional Viewing
Continuous Collision Detection: Progress and Challenges Gino van den Bergen dtecta
Computational Geometry & Collision detection
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
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.
Game Mathematics & Game State The Complexity of Games Expectations of Players Efficiency Game Mathematics o Collision Detection & Response o Object Overlap.
Mechanics, Dynamics & Aesthetics The Complexity of Games Expectations of Players Efficiency Game Mathematics o Collision Detection & Response o Object.
7.2 Volumes APPLICATIONS OF INTEGRATION In this section, we will learn about: Using integration to find out the volume of a solid.
What is an image? Light changes its path after reflection or refraction. Thus when we see something, we may not seeing the REAL thing at its true location.
Physics Simple – Pong Medium – Rigid bodies F = ma Circles, spheres, rectangles for collisions Complex – Fluids, clothings, explosions, hair.
6036: Area of a Plane Region AB Calculus. Accumulation vs. Area Area is defined as positive. The base and the height must be positive. Accumulation can.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Computer graphics & visualization Collision Detection – Narrow Phase.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Problems Ch(1-3).
Copyright © Cengage Learning. All rights reserved. 16 Vector Calculus.
Ray Model A useful model under certain circumstances to explain image formation. Ray Model: Light travels in straight-line paths, called rays, in ALL.
Momentum, Impulse, And Collisions
Collision handling: detection and response
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.
Newton’s Second Law of Motion. Force and Acceleration Force is a push or a pull acting on an object. Acceleration occurs when the VELOCITY of an object.
 When light strikes the surface of an object  Some light is reflected  The rest is absorbed (and transferred into thermal energy)  Shiny objects,
Problems Ch(1-3).
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
Haptic Rendering Part 2 4/CY/B3 Part 1. Collision detection and response Nic Melder Part 2. Manipulation and polygon transitions Nic Melder.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Microsoft® Small Basic Collision Detection Estimated time to complete this lesson: 1 hour.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Chipmunk Physics Remember that we talked about this a bit when we did collision handlers for the space ship integration task (SpritesActionsPhysicsSound).
Computer Game Design and Development
Ray-tracing.
Let’s Bounce! or Physics of Collisions Part 1 Games Fundamentals © by Jarek Francik Kingston University, London
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
AP Physics C Montwood High School R. Casao. When a wheel moves along a straight track, the center of the wheel moves forward in pure translation. A point.
Ray Model A useful model under certain circumstances to explain image formation. Ray Model: Light travels in straight-line paths, called rays, in ALL.
1 Sage Demo 4 Collisions SAGE Lecture Notes Ian Parberry University of North Texas.
Section 17.7 Surface Integrals. Suppose f is a function of three variables whose domain includes the surface S. We divide S into patches S ij with area.
Computer Game Design and Development Collision Detection Havok Destruction.
Elastic Collisions & Sierpinski Carpet Anakaren Santana.
Essential components of the implementation are:  Formation of the network and weight initialization routine  Pixel analysis of images for symbol detection.
1 Computer Game Physics The very basics. 2 The Basics Force F Mass m Acceleration a: a = F/m Velocity v: v = a*t Position s: s = v*t …if F is constant.
Game Programming 13 Physics in Games (cont.) 2010 년 2 학기 디지털콘텐츠전공.
Introduction to Game Programming & Design III Lecture III.
Copyright © Cengage Learning. All rights reserved. 5.2 Volumes
Fundamentals of Computer Animation Collision Detection and Response.
2D Collision Detection For CSE 3902 By: Matt Boggus.
3D Game Development and Computer Animation Collision Detection
Chapter 4.2 Collision Detection and Resolution
The height of the building
Mechanics, Dynamics & Aesthetics
Motion in Real and Virtual Worlds
Velocity & Acceleration
Computer Animation Algorithms and Techniques
Physics Engine for Soft Bodies
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
15.7 Triple Integrals.
Energy Problems.
Presentation transcript:

Collision Detection And Response Jae Chun KyungSoo Im Chau Vo Hoang Vu

Collision Detection Definition –Technique of deciding if an object has collided with another object or some aspect of the environment. Application –Virtual environments / simulation –Computer animation (physically based) –Game development

Collision Detection Methods Collision detection can be done in many ways. There isn’t a generic algorithm that works for all collisions.

1. BIOT Binary Image Overlap Testing –Uses the logical AND. –Logically AND two bitmaps for every pixel in each image. –If there is a region that both objects are occupying at the same time, the result of the AND operation will be an area of pixels. –If such area exists, the two objects have collided.

1. BIOT Pros –Most precise method of collision detection between bitmapped images. –Works for all shapes. Cons –Too much computation -> slow

2. Bounding Box –Suppose you have 2 objects of irregular shapes. –Represent each object with a bounding box (or a sphere). –Test if the bounding boxes overlap. Pros : Faster than BIOT. Cons : Can detect a collision when graphically, a collision has not occurred. –Solution1: Shrink size of the bounding box. –Solution2: Have multiple bounding boxes.

2. Bounding Box Pseudo Code –If (bottom1 left2) => collided –If (top1 > bottom2) && (left1 collided

3. Sphere - Sphere Collision Detection A. To determine if two static spheres collide: –Find distance between the 2 centers. –They collide if this distance is less than the sum of their two radii.

3. Sphere - Sphere Collision Detection B. To determine if two moving spheres collide: –First, decide the time intervals at which you want perform collision tests. –Then move the spheres according to that time interval using its velocity. (d = d0 + vt) –After that, check for collisions using the same method as checking for static spheres.

3. Sphere - Sphere Collision Detection –For example, suppose that your time interval is 1 milisecond. –Then every time 1 ms has passed, call the function that checks to see if the two spheres collide. Note: This method becomes more accurate if we use smaller time intervals. –But hardware might not be able to support it.

4. Sphere - Sphere Collision Detection - A Better Approach –First cast a ray from the center of the sphere with respect to the ball’s direction. –Find the point of intersection between the two rays.

4. Sphere - Sphere Collision Detection - A Better Approach –With this information there are may ways to detect collisions. One approach is to check for collision only when the balls are near the intersection point. –Another approach is to use laws of physics and calculate the time it takes for each ball to arrive to the intersection point. If the travel time for each ball are same, the two balls collide.

Collision Response –Now that we can detect collisions, the next step is to respond to these collisions. –Often times laws of physics are applied to determine how to respond to a collision.

A. Sphere - Plane Collision Response –V’ is the new direction vector V is the old direction vector before the collision N is the Normal at the collision point

A. Sphere - Plane Collision Response –Then the new vector V’ is calculated as follows: V’= 2 * ( -V dot N ) * N + V (where V and N are unit vectors) This works for all surfaces if a collision point and normal can be found.

B. Sphere - Sphere Collision Response –U1, U2 : velocity vectors of the two spheres at the time of impact. –X_Axis : a vector that joins the 2 centers of the spheres. –U1x, U2x : projected vectors of the velocity vectors U1,U2 onto the axis (X_Axis) vector. U1y and U2y : the projected vectors of the velocity vectors U1,U2 onto the axis which is perpendicular to the X_Axis. –M1, M2 : masses of the two spheres.

B. Sphere - Sphere Collision Response –Objective is to find vectors V1,V2 which are the new velocities after the impact. –Use Elastic Collision Formula : V1x = [(m1-m2)/(m1+m2)] U1x + [(2m2)/(m1+m2)] U2x V2x = [(2m1)/(m1+m2)] U1x + [(m2-m1)/(m1+m2)] U2x

B. Sphere - Sphere Collision Response Steps: –1) Find X_Axis X_Axis = (center2 - center1); make X_Axis into unit vector –2) Find U1x, U1y, U2x, U2y U1x = X_Axis * (X_Axis dot U1) U1y = U1 - U1x U2x = -X_Axis * (-X_Axis dot U2) U2y = U2 - U2x

B. Sphere - Sphere Collision Response –3) Plug the values into the Elastic Collision Formula to find final velocities of V1x, V2x Note: Since the vectors U1y and U2y do not touch with each other, we know that the final velocity vector for these will be the same. (V1y = U1y and V2y = U2y) –4) Find the final velocity vector for each ball V1f = V1x+V1y V2f = V2x+V2y

Sources / Credits / References Black Art of 3D Game Programming by Andre LaMothe (1995) (Text + Image on slide 5) sion_Detection.bw.pdf (Text) sion_Detection.bw.pdf ring/Lectures/18MoSim+CollDet+Wrap.ppt (Text) ring/Lectures/18MoSim+CollDet+Wrap.ppt (Text + Images on slide 16, 18) Original example/help code written by Jaeil Choi