Interaction and Normals

116
Interaction and Interaction and Normals Normals Intro to Programming in Intro to Programming in 3D Applications 3D Applications Lecture 20 Lecture 20

description

Interaction and Normals. Intro to Programming in 3D Applications Lecture 20. Collision handling detection & response. Particle-plane collision detection Polyhedron-polyhedron collision detection overlap of Bounding volumes Vertex inside polyhedron test Concave case Convex case - PowerPoint PPT Presentation

Transcript of Interaction and Normals

Page 1: Interaction and  Normals

Interaction and NormalsInteraction and Normals

Intro to Programming in 3D Intro to Programming in 3D ApplicationsApplications

Lecture 20Lecture 20

Page 2: Interaction and  Normals

Collision handlingdetection & response

Particle-plane collision detectionPolyhedron-polyhedron collision detection

overlap of Bounding volumesVertex inside polyhedron test

Concave caseConvex case

Edge-face intersection test

kinematic responsePenalty methodImpulse force of collision

detection

response

Page 3: Interaction and  Normals

Collision DetectionCollision Detection

• One part of the physics generally necessary in today’s One part of the physics generally necessary in today’s game environmentsgame environments

• BasicsBasics– Ray-Polygon IntersectionRay-Polygon Intersection– Object motion vector is the rayObject motion vector is the ray– Wall or other object is the polygon(s)Wall or other object is the polygon(s)– Simple to implementSimple to implement– Polygon-Polygon IntersectionPolygon-Polygon Intersection– Can be expensive to calculateCan be expensive to calculate

• Separate from Collision ResponseSeparate from Collision Response

Page 4: Interaction and  Normals

Ray BasicsRay Basics• Segment-Plane IntersectionSegment-Plane Intersection

– Intersect movement segment with plane of polygonIntersect movement segment with plane of polygon– Segment is defined by start and end pointsSegment is defined by start and end points

• Intersection PointIntersection Point– Find the exact 3D location of the intersectionFind the exact 3D location of the intersection

• Point in Polygon CheckPoint in Polygon Check– Easy for simple polygonsEasy for simple polygons

• Calculate dot product of edge normals to vectorCalculate dot product of edge normals to vector• Fast, Minimum Storage Ray-Triangle Intersection (best)Fast, Minimum Storage Ray-Triangle Intersection (best)

– http://www.acm.org/jgt/papers/MollerTrumbore97/http://www.acm.org/jgt/papers/MollerTrumbore97/– More difficult for concave polygonsMore difficult for concave polygons

• Sum angles between vectors to verticesSum angles between vectors to vertices• Divide polygon into quadrants, sum edge crossingsDivide polygon into quadrants, sum edge crossings• Scanline +/-Scanline +/-

• If the point is in the polygon the movement vector went If the point is in the polygon the movement vector went through the surface and we have a collisionthrough the surface and we have a collision

Page 5: Interaction and  Normals

Collision detection: point-plane

dpNdczbyaxpE )(

0)( pE

0)( pE

0)( pE

N

Page 6: Interaction and  Normals

Collision detection: time of impact

2 optionsConsider collision at next time stepCompute fractional time at which collision actually occurred

Tradeoff: accuracy v. complexity

Page 7: Interaction and  Normals

Intersection TestingIntersection Testing

• General goals: given two objects with current General goals: given two objects with current and previous orientations specified, determine if, and previous orientations specified, determine if, where, and when the two objects intersectwhere, and when the two objects intersect

• Alternative: given two objects with only current Alternative: given two objects with only current orientations, determine if they intersectorientations, determine if they intersect

• Sometimes, we need to find all intersections. Sometimes, we need to find all intersections. Other times, we just want the first one. Other times, we just want the first one. Sometimes, we just need to know if the two Sometimes, we just need to know if the two objects intersect and don’t need the actual objects intersect and don’t need the actual intersection data.intersection data.

Page 8: Interaction and  Normals

PrimitivesPrimitives• We often deal with various different ‘primitives’ that We often deal with various different ‘primitives’ that

we describe our geometry with. Objects are we describe our geometry with. Objects are constructed from these primitivesconstructed from these primitives

• ExamplesExamples– TrianglesTriangles– SpheresSpheres– CylindersCylinders– AABB = axis aligned bounding boxAABB = axis aligned bounding box– OBB = oriented bounding boxOBB = oriented bounding box

• At the heart of the intersection testing are various At the heart of the intersection testing are various primitive-primitive testsprimitive-primitive tests

Page 9: Interaction and  Normals

Particle CollisionsParticle Collisions

• mainly be concerned with the problem of testing mainly be concerned with the problem of testing if particles collide with solid objectsif particles collide with solid objects

• A particle can be treated as a line segment from A particle can be treated as a line segment from it’s previous position to it’s current positionit’s previous position to it’s current position

• If we are colliding against static objects, then we If we are colliding against static objects, then we just need to test if the line segment intersects just need to test if the line segment intersects the objectthe object

• Colliding against moving objects requires some Colliding against moving objects requires some additional modifications that we will also look atadditional modifications that we will also look at

Page 10: Interaction and  Normals

Segment vs. TriangleSegment vs. Triangle

• Does segment Does segment abab intersect triangle intersect triangle vv00vv11vv22 ? ?

•0v

x

a

b

1v

2v

Page 11: Interaction and  Normals

Segment vs. TriangleSegment vs. Triangle

• First, compute signed distances of a and b to planeFirst, compute signed distances of a and b to plane

• Reject if both are above or both are below triangleReject if both are above or both are below triangle

• Otherwise, find intersection point Otherwise, find intersection point xx

nvb

nva

0

0

b

a

d

d

ba

ba

dd

dd

ab

x

x

a

b

n

0v

ad •bd

Page 12: Interaction and  Normals

Segment vs. TriangleSegment vs. Triangle

• Is point x inside the triangle?Is point x inside the triangle?

(x-v(x-v00))·(·((v(v22-v-v00))××n) > 0n) > 0

• Test all 3 edgesTest all 3 edges

xv0

v1

v2

v2-v0

(v2-v0)×n

x-v0 •

Page 13: Interaction and  Normals

Faster WayFaster Way

• Reduce to 2D: remove smallest dimensionReduce to 2D: remove smallest dimension• Compute barycentric coordinatesCompute barycentric coordinates

xx'' =x-v =x-v00

ee11=v=v11-v-v00

ee22=v=v22-v-v00

αα=(x=(x'×'×ee2)2)/(e/(e11××ee22))

ββ=(x=(x'×'×ee1)1)/(e/(e11××ee22))• Reject if Reject if αα<0, <0, ββ<0 or <0 or αα++ββ >1 >1

xv0

v1

v2

α

β

Page 14: Interaction and  Normals

Segment vs. MeshSegment vs. Mesh

• To test a line segment against a mesh of To test a line segment against a mesh of triangles, simply test the segment against each triangles, simply test the segment against each triangletriangle

• Sometimes, we are interested in only the ‘first’ Sometimes, we are interested in only the ‘first’ hit along the segment from hit along the segment from aa to to bb. Other times, . Other times, we want all intersections. Still other times, we we want all intersections. Still other times, we just need any intersection.just need any intersection.

• Testing against lots of triangles in a large mesh Testing against lots of triangles in a large mesh can be time consuming. We will look at ways to can be time consuming. We will look at ways to optimize this lateroptimize this later

Page 15: Interaction and  Normals

Segment vs. Moving MeshSegment vs. Moving Mesh

• MM0 0 is the object’s matrix at time tis the object’s matrix at time t00

• MM1 1 is the matrix at time tis the matrix at time t11

• Compute delta matrix:Compute delta matrix:

MM11=M=M00··MMΔΔ

MMΔΔ== MM00-1-1··MM11

• Transform a by MTransform a by MΔΔ

aa''=a=a··MMΔΔ

• Test segment aTest segment a''b against object with matrix Mb against object with matrix M11

Page 16: Interaction and  Normals

Triangle vs. TriangleTriangle vs. Triangle

• Given two triangles: TGiven two triangles: T11 (u (u00uu11uu22) and T) and T22 (v (v00vv11vv22))

u0

u2

u1

v0

v1

v2

T1

T2

Page 17: Interaction and  Normals

Triangle vs. TriangleTriangle vs. Triangle

Step 1: Compute plane equationsStep 1: Compute plane equations

nn22=(v=(v11-v-v00))××(v(v22-v-v00))

dd22=-n=-n22··vv00

v0

v1

v2

v1-v0

v2-v0

n

Page 18: Interaction and  Normals

Triangle vs. TriangleTriangle vs. Triangle

• Step 2: Compute signed distances of TStep 2: Compute signed distances of T11 vertices to vertices to

plane of Tplane of T22::

ddii=n=n22·u·uii+d+d22 (i=0,1,2)(i=0,1,2)

• Reject if all dReject if all dii<0 or all d<0 or all dii>0>0

• Repeat for vertices of TRepeat for vertices of T22 against plane of T against plane of T11

d0

u0

Page 19: Interaction and  Normals

Triangle vs. TriangleTriangle vs. Triangle

• Step 3: Find intersection pointsStep 3: Find intersection points

• Step 4: Determine if segment pq is inside Step 4: Determine if segment pq is inside triangle or intersects triangle edgetriangle or intersects triangle edge

p q

Page 20: Interaction and  Normals

Mesh vs. MeshMesh vs. Mesh

• Geometry: points, edges, facesGeometry: points, edges, faces

• Collisions: p2p, p2e, p2f, e2e, e2f, f2fCollisions: p2p, p2e, p2f, e2e, e2f, f2f

• Relevant ones: p2f, e2e (point to face & Relevant ones: p2f, e2e (point to face & edge to edge)edge to edge)

• Multiple simultaneous collisionsMultiple simultaneous collisions

Page 21: Interaction and  Normals

Sphere-Sphere IntersectionSphere-Sphere Intersection

• Two objects are said to have collided if their bounding Two objects are said to have collided if their bounding spheres intersect.spheres intersect.

• To determine if two spheres intersect, simply calculate To determine if two spheres intersect, simply calculate the distance between the centers of the two spheres.the distance between the centers of the two spheres.

• If the distance is greater than the sum of the two sphere If the distance is greater than the sum of the two sphere radii, they don’t intersect. Otherwise they intersect.radii, they don’t intersect. Otherwise they intersect.

r1

r2

d = r1 + r2

d > r1 + r2

Page 22: Interaction and  Normals

Sphere-Plane IntersectionSphere-Plane Intersection

• Sometimes, it’s necessary to find the intersection Sometimes, it’s necessary to find the intersection between a sphere and a plane, for example, the between a sphere and a plane, for example, the bounding sphere of an object with a wall (or bounding sphere of an object with a wall (or slope).slope).

• Given that the equation of the plane is Given that the equation of the plane is nn..pp = k = k (where (where nn is the unit normal of the plane, is the unit normal of the plane, pp is any is any point on the plane, and k is a number)point on the plane, and k is a number)– Then, given the center coordinates Then, given the center coordinates CC of the sphere, of the sphere,

and the radius r of the sphere,and the radius r of the sphere,• The sphere and the plane intersect if |(The sphere and the plane intersect if |(nn..CC) – k| < r) – k| < r

Page 23: Interaction and  Normals

Dot ProductDot Product

• Let Let UU and and VV be vectors such that be vectors such that UU = (U = (Uxx, U, Uyy, U, Uzz), ),

and and VV = (V = (Vxx, V, Vyy, V, Vzz))

• Then, the dot product Then, the dot product UU..VV = U = UxxVVxx + U + UyyVVyy + U + UzzVVzz

• UU..VV is also equal to | is also equal to |UU||||VV| cos q where q is the | cos q where q is the angle between angle between UU and and VV..

U

Vq

Page 24: Interaction and  Normals

Collision of Fast-Moving ObjectsCollision of Fast-Moving Objects

• We need a different method to detect collision of fast-We need a different method to detect collision of fast-moving, and often small, objects.moving, and often small, objects.

• Example, a bullet is fired, and we want to see if it intersects Example, a bullet is fired, and we want to see if it intersects a wall. However, if we examine every time frame, because a wall. However, if we examine every time frame, because the bullet moves very fast, even though at some point in the bullet moves very fast, even though at some point in time it intersects the wall, we may only sample it in front of time it intersects the wall, we may only sample it in front of the wall and behind it, but on at the point of intersection.the wall and behind it, but on at the point of intersection.

• Therefore, we need to consider the path of the bullet, and Therefore, we need to consider the path of the bullet, and determine if that path intersects the wall.determine if that path intersects the wall.

• We use a line to represent the path of the bullet. We then We use a line to represent the path of the bullet. We then test for line-object intersection. We consider:test for line-object intersection. We consider:– Line-Sphere intersection, andLine-Sphere intersection, and– Line-Triangle intersectionLine-Triangle intersection

Page 25: Interaction and  Normals

Line-Sphere IntersectionLine-Sphere Intersection

• Let a point on a line be X(t) = P + tDLet a point on a line be X(t) = P + tD– Here X(t) is a function of t, and gives the point Here X(t) is a function of t, and gives the point

on the line, P is the starting point of the line, on the line, P is the starting point of the line, and D is a unit vector in the direction of the line.and D is a unit vector in the direction of the line.

• Let a point on a sphere satisfy | X – C | = rLet a point on a sphere satisfy | X – C | = r– Here, X is a point on the sphere, C is the center Here, X is a point on the sphere, C is the center

of the sphere, and r is the radius of the sphere.of the sphere, and r is the radius of the sphere.

Page 26: Interaction and  Normals

Line-Sphere IntersectionLine-Sphere Intersection

• Suppose the line and sphere intersect at point X, then Suppose the line and sphere intersect at point X, then | P + tD – C || P + tD – C |22 – r – r22 = 0 = 0– Let M = P – C. Then, | tD + M |Let M = P – C. Then, | tD + M |22 – r – r22 = 0 = 0– Expanding, tExpanding, t22 + 2D.Mt + | M | + 2D.Mt + | M |22 – r – r22 = 0 = 0

• See Note 1 on next pageSee Note 1 on next page– Solving for t, t = -D.M +/- sqrt((D.M)Solving for t, t = -D.M +/- sqrt((D.M)22 – ( | M | – ( | M |22 – r – r22 )) ))

• See Note 2 on next pageSee Note 2 on next page– The discriminant d is (D.M)The discriminant d is (D.M)22 – ( | M | – ( | M |22 – r – r22 ) )

• If d > 0, the line and sphere intersect at two points.If d > 0, the line and sphere intersect at two points.• If d = 0, the line and sphere intersect at one point.If d = 0, the line and sphere intersect at one point.• If d < 0, the line and sphere don’t intersect.If d < 0, the line and sphere don’t intersect.

– If (d>0) or (d=0), we can solve for t. Assuming that P is the position If (d>0) or (d=0), we can solve for t. Assuming that P is the position of the fast-moving object at the beginning of the game loop, and D of the fast-moving object at the beginning of the game loop, and D is the vector that it will travel during a game loop, then the objects is the vector that it will travel during a game loop, then the objects intersect during this game loop if 0<t<1.intersect during this game loop if 0<t<1.

Page 27: Interaction and  Normals

Notes on Line-Sphere IntersectionNotes on Line-Sphere Intersection|a+b|2 = |a|2 + |b|2 + 2a.b

a

ba+b

ax

by

bx

ay

Proof: |a+b|2 = (ax+bx)2 + (ay+by)2

= ax2 + 2axbx + bx

2 + ay2+ 2ayby + by

2

But, |a|2 = ax2 + ay

2 and |b|2 = bx2 + by

2

Therefore, |a+b|2 = |a|2 + |b|2 + 2(axbx + ayby)

|a+b|2 = |a|2 + |b|2 + 2a.b

Note 1 Note 2

Let A, B and C be coefficients of the quadratic equation:

Ax2 + Bx + C = 0

Then, x = -B +/- sqrt(B2-4AC) 2A

Page 28: Interaction and  Normals

Line-Triangle IntersectionLine-Triangle Intersection

• Once again, let a point on a line be X(t) = Once again, let a point on a line be X(t) = P + tDP + tD

• Let a triangle be defined by its three Let a triangle be defined by its three corner points Pcorner points P00, P, P11 and P and P22..

• Strategy: Strategy: – First, find the intersection between the line First, find the intersection between the line

and the plane containing the triangle.and the plane containing the triangle.– Then, find out if this point is within the triangleThen, find out if this point is within the triangle

Page 29: Interaction and  Normals

Line-Triangle IntersectionLine-Triangle IntersectionThe Plane Containing the TriangleThe Plane Containing the Triangle

Equation of a plane:A point p on the plane will satisfy the equation p.n = kwhere n is the normal of the plane.

Step 1: Find the normal n of the planeLet edge e0 be P1 – P0.Let edge e1 be P2 – P1.Then n = e0 x e1

In other words, the normal of the plane is the cross product of two edges.

Step 2: Find kk = P0.n

Page 30: Interaction and  Normals

Line-Triangle IntersectionLine-Triangle IntersectionLine-Plane IntersectionLine-Plane Intersection

1. Substitute equation of the line into equation of the plane.

(P + tD) . n = k

2. Find t.

Re-arranging, t = (k – P.n)/(D.n)

3. Substitute t back to get intersection point.

Intersection point R = P + tD.

Page 31: Interaction and  Normals

Line-Triangle IntersectionLine-Triangle IntersectionCheck if point is within triangleCheck if point is within triangle

P0 P1

P2

R

e0

e1e2

Therefore, Point R is inside the triangle if:

(e0 x (R – P0)) . n > 0 and

(e1 x (R – P1)) . n > 0 and

(e2 x (R – P2)) . n > 0

Remember that the cross product of consecutive vectors going counter-clockwise will always be of the same sign.

R is inside the triangle if it is always to the left side of each edge.

Page 32: Interaction and  Normals

Speeding up Collision DetectionSpeeding up Collision Detection

• Spatial subdivision methodSpatial subdivision method

• Divide the space into different regions.Divide the space into different regions.

• At each step, determine which region each At each step, determine which region each object is in.object is in.

• Only test objects in the same region for Only test objects in the same region for collision.collision.

Page 33: Interaction and  Normals

Collision detection: polyhedra

2. test for vertex of one object inside of other object

1. test bounding volumes for overlap

3. test for edge of one object intersecting face of other object

Order tests according to computational complexity and power of detection

Page 34: Interaction and  Normals

Collision detection: bounding volumes

Don’t do vertex/edge intersection testing if there’s no chance of an intersection between the polyhedra

Want a simple test to remove easy cases

Tradeoff complexity of test with power to reject non-intersecting polyhedra(goodness of fit of bounding volume)

Page 35: Interaction and  Normals

Bounding Spheres

Compute bounding sphere of verticesCompute in object space and transform with object

1.Find min/max pair of points in each dimension

2. use maximally separated pair – use to create initial bounding sphere (midpoint is center)

3. for each vertex adjust sphere to include point

Page 36: Interaction and  Normals

Bounding Boxes

Axis-aligned (AABB): use min/max in each dimension

Oriented (OBB): e.g., use AABB in object space and transform with object. Vertex is inside of OBB if on inside of 6 planar equations

Page 37: Interaction and  Normals

Bounding Slabs

For better fit bounding polyhedron: use arbitrary (user-specified) collection of bounding plane-pairs

Is a vertex between each pair?

12 dPNd

Page 38: Interaction and  Normals

Convex HullBest fit convex polyhedron to concave polyhedron but takes some (one-time) computation

1. Find highest vertex, V12. Find remaining vertex that minimizes

angle with horizontal plane through point. Call edge L

3. Form plane with this edge and horizontal line perpendicular to L at V1

4. Find remaining vertex that for triangle that minimizes angle with this plane. Add this triangle to convex hull, mark edges as unmatched

5. For each unmatched edge, find remaining vertex that minimizes angle with the plane of the edge’s triangle

Page 39: Interaction and  Normals

Collision detection: polyhedra

2. test for vertex of one object inside of other object

1. test bounding volumes for overlap

3. test for edge of one object intersecting face of other object

Page 40: Interaction and  Normals

Collision detection: polyhedra

Intersection = NOFor each vertex, V, of object A

if (V is inside of B) intersection = YESFor each vertex, V, of object B

if (V is inside of A) intersection = YES

A vertex is inside a convex polyhedron if it’s on the ‘inside’ side of all faces

A vertex is inside a cancave polyhedron if a semi-infinite ray from the vertex intersects an odd number of faces

Page 41: Interaction and  Normals

Collision detection: polyhedra

Edge intersection face testFinds ALL polyhedral intersectionsBut is most expensive test

If vertices of edges are on opposite side of plane of face

Calculate intersection of edge with plane

Test vertex for inside face (2D test in plane of face)

Page 42: Interaction and  Normals

Collision detection: swept volumeTime & relative direction of travel sweeps out a volumeOnly tractable in simple cases (e.g. linear translation)

If part of an object is in the volume, it was intersected by object

Page 43: Interaction and  Normals

Laws of MotionLaws of Motion

• First law simplified into the sentence First law simplified into the sentence "A body "A body continues to maintain its state of rest or continues to maintain its state of rest or of uniform motion unless acted upon by an of uniform motion unless acted upon by an external unbalanced force."external unbalanced force." This law is This law is known as the law of inertia. known as the law of inertia.

• Second law is often stated as Second law is often stated as "F = ma: the net "F = ma: the net force on an object is equal to the mass of force on an object is equal to the mass of the object multiplied by its acceleration."the object multiplied by its acceleration."

• Third law Whenever a particle Third law Whenever a particle AA exerts a force exerts a force on another particle on another particle BB, , BB simultaneously exerts a simultaneously exerts a force on force on AA with the same magnitude in the with the same magnitude in the opposite direction. This law is often simplified opposite direction. This law is often simplified as as "To every action there is an equal and "To every action there is an equal and opposite reaction."opposite reaction."

Page 44: Interaction and  Normals

Linear Momentum and CollisionsLinear Momentum and Collisions

Linear momentumLinear momentum is defined as:is defined as:

pp = = mmvv

Momentum is given by mass times velocity. Momentum is given by mass times velocity.

Momentum is a vector.Momentum is a vector.

The units of momentum are (no special unit):The units of momentum are (no special unit):

[p] = kg[p] = kg··m/sm/s

Page 45: Interaction and  Normals

SinceSince pp is a vector, we can also consideris a vector, we can also consider thethe components of momentum:components of momentum:

ppxx = mv = mvxx

ppyy = mv = mvyy

ppzz = mv = mvzz

Note: momentum is “large” if Note: momentum is “large” if mm and/or and/or vv is is large. (define large, meaning hard for large. (define large, meaning hard for you to stop).you to stop).

• Name an object with large momentum but Name an object with large momentum but small velocity.small velocity.

• Name an object with large momentum but Name an object with large momentum but small masssmall mass

Page 46: Interaction and  Normals

Recall thatRecall that

tt

mt

m

pv F

vaaF and

Another way of writing Newton’s Second Law is

F = Dp/Dt= rate of change of momentum

This form is valid even if the mass is changing.

This form is valid even in Relativity and Quantum Mechanics.

Page 47: Interaction and  Normals

ImpulseImpulse

We can rewrite We can rewrite FF = D = Dpp/D/Dtt as: as:

FFDDtt = D = Dpp

I = FI = FDDtt is known as the is known as the impulse.impulse.

The impulse of the force acting on an object equals The impulse of the force acting on an object equals the change in the momentum of that object.the change in the momentum of that object.

Page 48: Interaction and  Normals

If there are no external forces on a If there are no external forces on a system, then the total momentum of that system, then the total momentum of that system is constant. This is known as:system is constant. This is known as:

The Principle of The Principle of

Conservation Conservation

of of

MomentumMomentum

In that case, In that case, ppii = = ppff..

Page 49: Interaction and  Normals

Conservation of MomentumConservation of Momentum

• In the absence of external forces, the total In the absence of external forces, the total momentum of a given system remains momentum of a given system remains constant.constant.

A 90 kg hockey player traveling with a velocity of 6 m/s collides head-on with an 80 A 90 kg hockey player traveling with a velocity of 6 m/s collides head-on with an 80 kg player traveling a 7 m/s. If the two players entangle and continue traveling kg player traveling a 7 m/s. If the two players entangle and continue traveling together as a unit following the collision, what is their combined velocity?together as a unit following the collision, what is their combined velocity?

Known: mKnown: m11= 90 kg m= 90 kg m22=80 kg v=80 kg v11= 6 m/s v= 6 m/s v22= -7 m/s= -7 m/s

m1v1 + mm1v1 + m22vv22 = (m = (m11 + m + m22) (v)) (v)(90 kg) (6 m/s) + (80 kg) (-7 m/s) = (90 kg + 80 kg) (v)(90 kg) (6 m/s) + (80 kg) (-7 m/s) = (90 kg + 80 kg) (v)

540 kg m/s – 560 kg m/s = (170 kg) (v)540 kg m/s – 560 kg m/s = (170 kg) (v)- 20 kg m/s = (170 kg) (v)- 20 kg m/s = (170 kg) (v)

v = 0.12 m/s in the direction of the 80 kg player’s original direction of travel v = 0.12 m/s in the direction of the 80 kg player’s original direction of travel

Page 50: Interaction and  Normals

Conservation of Momentum and Conservation of Momentum and Newton’s Third LawNewton’s Third Law

• Consider a system consisting of just the two masses mConsider a system consisting of just the two masses m11 and mand m22..

• Mass mMass m11 exerts a force F exerts a force F2121 on mass m on mass m22..• Mass mMass m22 exerts a force F exerts a force F1212 on mass m on mass m11..• Force on mForce on m11 = rate of change of momentum of m = rate of change of momentum of m11

– FF1212 =Dp =Dp11 / Dt / Dt

• Force on mForce on m22 = rate of change of momentum of m = rate of change of momentum of m22

– FF2121 =Dp =Dp22 / Dt / Dt

• DpDp11 / Dt + Dp / Dt + Dp22 / Dt = F / Dt = F1212 + F + F2121 = 0 (Newton’s Third Law). = 0 (Newton’s Third Law).• D(pD(p11+p+p22 )/ Dt = 0 )/ Dt = 0• Rate of change of total momentum is zero.Rate of change of total momentum is zero.• Total Momentum does not change if net external force Total Momentum does not change if net external force

is zerois zero– Composite objects can be treated like point particlesComposite objects can be treated like point particles

Page 51: Interaction and  Normals

Internal vs. External ForcesInternal vs. External Forces

system

Here the system is just the box and table. Any forces between those two objects are internal. Example: The normal forces between the table and the box are internal forces. Internal forces on the system sum to zero.

External forces do not necessarily sum to zero. Something outside the circle is pushing or pulling something inside the circle.

Example: gravity is an external force.

Page 52: Interaction and  Normals

Impulse and BouncingImpulse and Bouncing

• Impulses are greater Impulses are greater when bouncing takes when bouncing takes place.place.

• The impulse required The impulse required to bring an object to a to bring an object to a stop and then throw it stop and then throw it back again is greater back again is greater than the impulse than the impulse required to bring an required to bring an object to a stop.object to a stop.

Page 53: Interaction and  Normals

The ForcesThe Forces

Equal and Opposite

Page 54: Interaction and  Normals

More About Impulse: F-t The More About Impulse: F-t The GraphGraph

• Impulse is a vector quantityImpulse is a vector quantity• The magnitude of the The magnitude of the

impulse is equal to the area impulse is equal to the area under the force-time curveunder the force-time curve

• Dimensions of impulse are Dimensions of impulse are M L / TM L / T

• Impulse is not a property of Impulse is not a property of the particle, but a measure the particle, but a measure of the change in momentum of the change in momentum of the particleof the particle

Page 55: Interaction and  Normals

ImpulseImpulse• If your car runs into a If your car runs into a

brick wall and you come brick wall and you come to rest along with the to rest along with the car, there is a significant car, there is a significant change in momentum. change in momentum. If you are wearing a seat If you are wearing a seat belt or if the car has an belt or if the car has an air bag, your change in air bag, your change in momentum occurs over momentum occurs over a relatively long time a relatively long time interval. If you stop interval. If you stop because you hit the because you hit the dashboard, your change dashboard, your change in momentum occurs in momentum occurs over a very short time over a very short time interval.interval.

Page 56: Interaction and  Normals

ImpulseImpulse

• The impulse can also The impulse can also be found by using the be found by using the time averaged forcetime averaged force

• II = Dt = Dt

• This would give the This would give the same impulse as the same impulse as the time-varying force time-varying force doesdoes

F

Page 57: Interaction and  Normals

RecoilRecoil• Recoil is the term that describes the backward Recoil is the term that describes the backward

movement of an object that has propelled movement of an object that has propelled another object forward. In the nuclear decay another object forward. In the nuclear decay example, the vexample, the vnn’ would be the recoil velocity.’ would be the recoil velocity.

Page 58: Interaction and  Normals

Conservation of Momentum, Conservation of Momentum, Archer ExampleArcher Example• The archer is standing The archer is standing

on a frictionless surface on a frictionless surface (ice)(ice)

• Approaches:Approaches:– Newton’s Second Law –Newton’s Second Law –

no information about no information about FF or or aa

– Energy approach – no Energy approach – no information about work or information about work or energyenergy

– Momentum – yesMomentum – yes

Page 59: Interaction and  Normals

Archer Example, 2Archer Example, 2

• Let the system be the archer with bow (particle Let the system be the archer with bow (particle 1) and the arrow (particle 2)1) and the arrow (particle 2)

• There are no external forces in the There are no external forces in the xx-direction, -direction, so it is isolated in terms of momentum in the so it is isolated in terms of momentum in the xx--directiondirection

• Total momentum before releasing the arrow is 0Total momentum before releasing the arrow is 0• The total momentum after releasing the arrow is The total momentum after releasing the arrow is

pp1f1f + + pp2f2f = 0 = 0

Page 60: Interaction and  Normals

Archer Example, finalArcher Example, final

• The archer will move in the opposite The archer will move in the opposite direction of the arrow after the releasedirection of the arrow after the release– Agrees with Newton’s Third LawAgrees with Newton’s Third Law

• Because the archer is much more massive Because the archer is much more massive than the arrow, his acceleration and than the arrow, his acceleration and velocity will be much smaller than those of velocity will be much smaller than those of the arrowthe arrow

Page 61: Interaction and  Normals

Overview: Collisions – Overview: Collisions – Characteristics Characteristics • We use the term We use the term collisioncollision to represent an event to represent an event

during which two particles come close to each during which two particles come close to each other and interact by means of forcesother and interact by means of forces

• The time interval during which the velocity The time interval during which the velocity changes from its initial to final values is changes from its initial to final values is assumed to be shortassumed to be short

• The interaction force is assumed to be much The interaction force is assumed to be much greater than any external forces presentgreater than any external forces present– This means the impulse approximation can be usedThis means the impulse approximation can be used

Page 62: Interaction and  Normals

What goes on during the collision? What goes on during the collision?

Force on m2

=F(12)

Force on m1

=F(21)

Page 63: Interaction and  Normals

CollisionsCollisions

In general, a “collision” is an interaction in which In general, a “collision” is an interaction in which

• two objects strike one anothertwo objects strike one another

• the net external impulse is zero or negligibly the net external impulse is zero or negligibly small (momentum is conserved)small (momentum is conserved)

Examples: car crash; billiard ballsExamples: car crash; billiard balls

Collisions can involve more than 2 objectsCollisions can involve more than 2 objects

Page 64: Interaction and  Normals

Consider two particles:Consider two particles:

1 2

m1 m2

v1v2

V1 V2

1 2

1 2

Page 65: Interaction and  Normals

What about conservation of What about conservation of energyenergy??

The The total energytotal energy of an isolated system is of an isolated system is conserved, but the conserved, but the total kinetic energytotal kinetic energy may change.may change.

• elastic collisions: K elastic collisions: K isis conserved conserved• inelastic collisions: K inelastic collisions: K is notis not conserved conserved

• perfectly inelastic: objects stick together perfectly inelastic: objects stick together after collidingafter colliding

Page 66: Interaction and  Normals

Collisions – Example 1 Collisions – Example 1

• Collisions may be the Collisions may be the result of direct contactresult of direct contact

• The impulsive forces The impulsive forces may vary in time in may vary in time in complicated wayscomplicated ways– This force is internal to This force is internal to

the systemthe system

• Momentum is Momentum is conservedconserved

Page 67: Interaction and  Normals

Perfectly Inelastic CollisionsPerfectly Inelastic Collisions

After a perfectly inelastic collision the two After a perfectly inelastic collision the two objects stick together and move with the objects stick together and move with the same final velocity:same final velocity:

ppii = = ppff

mm1 1 vv1,i1,i + m + m2 2 vv2,i2,i = (m = (m11+ m+ m22))vvff

This gives the maximum possible loss of kinetic energy.In non-relativistic collisions, the total mass is conserved

Page 68: Interaction and  Normals

From the conservation of momentum:From the conservation of momentum:

ppii = = ppff

mm11vv1,i1,i ++ m m22vv2,i2,i == mm11vv1,f1,f ++ m m22vv2,f2,f

v2,f

v2,i

v1,f

v1,i

Page 69: Interaction and  Normals

Perfectly Inelastic CollisionsPerfectly Inelastic Collisions

• Since the objects Since the objects stick together, they stick together, they share the same share the same velocity after the velocity after the collisioncollision

• mm11vv11ii + + mm22vv22ii = =

((mm11 + + mm22) ) vvff

Page 70: Interaction and  Normals

Elastic CollisionsElastic Collisions

Kinetic energy is conserved and Kinetic energy is conserved and momentum is conserved:momentum is conserved:

ppii = = ppff

KKii = K = Kff

2,22

2,11

2,22

2,11

,22,11,22,11

2

1

2

1

2

1

2

1ffii

ffii

vmvmvmvm

mmmm

vvvv

Page 71: Interaction and  Normals

Elastic CollisionsElastic Collisions

• Both momentum and Both momentum and kinetic energy are kinetic energy are conservedconserved

1 1 2 2

1 1 2 2

2 21 1 2 2

2 21 1 2 2

1 1

2 21 1

2 2

i i

f f

i i

f f

m m

m m

m m

m m

v v

v v

v v

v v

Page 72: Interaction and  Normals

Elastic Collisions in 1-Elastic Collisions in 1-dimensiondimensionKinetic energy is conserved in addition to Kinetic energy is conserved in addition to

momentum:momentum:

ppii = p = pff

KKii = K = Kff

ffii

iffi

ififfifi

iffi

ffii

iffi

ffii

vvvv

vvvv

vvvvmvvvvm

vvmvvm

vmvmvmvm

vvmvvm

vmvmvmvm

,1,2,2,1

,2,2,1,1

,2,2,2,22,1,1,1,11

2,2

2,22

2,1

2,11

2,22

2,11

2,22

2,11

,2,22,1,11

,22,11,22,11

:Divide

2

1

2

1

2

1

2

1

Relative velocity of approach before collision = relative velocity of separation after collision

Page 73: Interaction and  Normals

***Inelastic head-on collision between a ***Inelastic head-on collision between a car and a truck…car and a truck…

Page 74: Interaction and  Normals

A 3000-kg truck moving with a velocity of 20 m/s rear-A 3000-kg truck moving with a velocity of 20 m/s rear-ends a 1000-kg parked car. The impact causes the ends a 1000-kg parked car. The impact causes the 1000-kg car to be set in motion at 15 m/s. Are the two 1000-kg car to be set in motion at 15 m/s. Are the two vehicles stuck together after the collision?vehicles stuck together after the collision?

Page 75: Interaction and  Normals

***The animation below portrays the elastic collision ***The animation below portrays the elastic collision between a 1000-kg car and a 3000-kg truck.between a 1000-kg car and a 3000-kg truck.

Page 76: Interaction and  Normals

Two Dimensional Collisions Two Dimensional Collisions

Page 77: Interaction and  Normals

Do you know how to play Do you know how to play pool?pool?

Page 78: Interaction and  Normals

ReboundRebound

• When objects/bodies separate (move apart) after a When objects/bodies separate (move apart) after a collision or impact occurs.collision or impact occurs.

• Angle of incidence and angle of reflection/rebound Angle of incidence and angle of reflection/rebound measured with respect to the vertical.measured with respect to the vertical.

• Coefficient of elasticity/restitution refers to the degree Coefficient of elasticity/restitution refers to the degree (amount) of recoil/bounce that objects have. The greater (amount) of recoil/bounce that objects have. The greater the bounce the greater the coefficient (value between 0 the bounce the greater the coefficient (value between 0 and 1) with 0 signifying a completely inelastic object and and 1) with 0 signifying a completely inelastic object and 1 signifying a completely elastic object.1 signifying a completely elastic object.

• Affected by temperature and rebounding surface. Heat Affected by temperature and rebounding surface. Heat causes balls to bounce more while artificial turf also will causes balls to bounce more while artificial turf also will cause a greater bounce.cause a greater bounce.

Page 79: Interaction and  Normals

Angle of Reflection/ReboundAngle of Reflection/Rebound

Incidence Rebound

Page 80: Interaction and  Normals

A 3.00-kg steel ball strikes a wall with a speed of 10.0 m/s at an angle of 60.0° with the surface. It bounces off with the same speed and angle (Fig. P9.9). If the ball is in contact with the wall for 0.200 s, what is the average force exerted on the ball by the wall?

Page 81: Interaction and  Normals

Two-Dimensional CollisionsTwo-Dimensional Collisions

• The momentum is conserved in all directionsThe momentum is conserved in all directions

• Use subscripts forUse subscripts for– identifying the objectidentifying the object– indicating initial or final valuesindicating initial or final values– the velocity componentsthe velocity components

• If the collision is elastic, use conservation of If the collision is elastic, use conservation of kinetic energy as a second equationkinetic energy as a second equation– Remember, the simpler equation can only be used for Remember, the simpler equation can only be used for

one-dimensional situationsone-dimensional situations

Page 82: Interaction and  Normals

Two-Dimensional Collision, Two-Dimensional Collision, exampleexample• Particle 1 is moving at Particle 1 is moving at

velocity velocity vv11ii and and

particle 2 is at restparticle 2 is at rest

• In the In the xx-direction, the -direction, the initial momentum is initial momentum is mm11vv11ii

• In the In the yy-direction, the -direction, the initial momentum is 0initial momentum is 0

Page 83: Interaction and  Normals

Two-Dimensional Collision, Two-Dimensional Collision, example contexample cont• After the collision, the After the collision, the

momentum in the momentum in the xx--direction is direction is mm11vv11ff cos cos qq

+ + mm22vv22ff cos cos ff• After the collision, the After the collision, the

momentum in the momentum in the yy--direction is direction is mm11vv11ff sin sin qq

+ + mm22vv22ff sin sin ff

Page 84: Interaction and  Normals

Two-Dimensional Collision Two-Dimensional Collision ExampleExample• Before the collision, Before the collision,

the car has the total the car has the total momentum in the momentum in the xx--direction and the van direction and the van has the total has the total momentum in the momentum in the yy--directiondirection

• After the collision, After the collision, both have both have xx- and - and yy--componentscomponents

Page 85: Interaction and  Normals

Elastic Collisions Involving an Elastic Collisions Involving an AngleAngle

• Momentum is conserved in both the Momentum is conserved in both the x-direction and in the y-direction.x-direction and in the y-direction.

• Before:Before:

positivevv

positivevv

negativevv

positivevv

y

x

y

x

222

222

111

111

sin

cos

sin

cos

Page 86: Interaction and  Normals

Elastic Collisions Involving an Elastic Collisions Involving an AngleAngle

• After:After:

negativeθsin'v'v

positiveθcos'v'v

positiveθsin'v'v

positiveθcos'v'v

42y2

42x2

31y1

31x1

Page 87: Interaction and  Normals

Elastic Collisions Involving an AngleElastic Collisions Involving an Angle

• Directions for the velocities before and Directions for the velocities before and after the collision must include the after the collision must include the positive or negative sign.positive or negative sign.

• The direction of the x-components for The direction of the x-components for vv11 and v and v22 do not change and therefore do not change and therefore remain positive.remain positive.

• The directions of the y-components for The directions of the y-components for vv11 and v and v22 do change and therefore one do change and therefore one velocity is positive and the other velocity is positive and the other velocity is negative.velocity is negative.

Page 88: Interaction and  Normals

Elastic Collisions Involving an AngleElastic Collisions Involving an Angle

• ppxx before = p before = pxx after after

• ppyy before = p before = pyy after after

• Velocity after collision:Velocity after collision:

'vm'vmvmvm x22x11x22x11

'vm'vmvmvm y22y11y22y11

2y2

2x22

2y1

2x11

'v'v'v

'v'v'v

Page 89: Interaction and  Normals

Elastic CollisionsElastic Collisions

• Perfectly elastic collisions do not Perfectly elastic collisions do not have to be head-on. have to be head-on.

• Particles can divide or break apart.Particles can divide or break apart.

• Example: nuclear decay (nucleus Example: nuclear decay (nucleus of an element emits an alpha of an element emits an alpha particle and becomes a different particle and becomes a different element with less mass)element with less mass)

Page 90: Interaction and  Normals

Elastic CollisionsElastic Collisions

• mmnn = mass of nucleus = mass of nucleus

• mmpp = mass of alpha particle = mass of alpha particle

• vvnn = velocity of nucleus before event = velocity of nucleus before event

• vvnn’ = velocity of nucleus after event’ = velocity of nucleus after event

• vvpp = velocity of particle after event = velocity of particle after event

ppnpnnn vm'vmmvm

Page 91: Interaction and  Normals

Head-on and Glancing CollisionsHead-on and Glancing Collisions

• Head-on collisions occur when all of the Head-on collisions occur when all of the motion, before and after the collision, is motion, before and after the collision, is along one straight line.along one straight line.

• Glancing collisions involve an angle.Glancing collisions involve an angle.• A vector diagram can be used to represent A vector diagram can be used to represent

the momentum for a glancing collision.the momentum for a glancing collision.

Page 92: Interaction and  Normals

Vector DiagramsVector Diagrams

• Use the three vectors and construct a Use the three vectors and construct a triangle.triangle.

Page 93: Interaction and  Normals

Vector DiagramsVector Diagrams

• Use the Use the appropriate appropriate expression to expression to determine the determine the unknown unknown variable.variable.

35sin'vm

30sinvm

35sin'vm

115sinvm

30sinvm

115sinvm

BBRR

BBBB

AABB

Page 94: Interaction and  Normals

Vector DiagramsVector Diagrams

• Total vector momentum is conserved. You Total vector momentum is conserved. You could break each momentum vector into an x could break each momentum vector into an x and y component.and y component.

ppxx before = p before = pxx after after

ppyy before = p before = pyy after after• You would use the x and y components to You would use the x and y components to

determine the resultant momentum for the object determine the resultant momentum for the object in questionin question

• Resultant momentum = Resultant momentum = 2

y2

x pp

Page 95: Interaction and  Normals

Vector DiagramsVector Diagrams• Right triangle trigonometry can be used Right triangle trigonometry can be used

to solve this type of problem:to solve this type of problem:

Page 96: Interaction and  Normals

Vector DiagramsVector Diagrams

• Pythagorean theorem:Pythagorean theorem:

• If the angle If the angle for the direction in which the for the direction in which the cars go in after the collision is known, you can cars go in after the collision is known, you can use sin, cos, or tan to determine the unknown use sin, cos, or tan to determine the unknown quantity. Example: determine final velocity vquantity. Example: determine final velocity vTT if the angle is 25°.if the angle is 25°.

2Tba2

bb2

aa vmmvmvm

Tba

bb

Tba

aa

vmmvm

25cos

vmmvm

25sin

Page 97: Interaction and  Normals

Vector DiagramsVector Diagrams

• To determine the angle at which the cars go off To determine the angle at which the cars go off together after the impact: together after the impact:

bb

aa1

vmvm

tanθ

Page 98: Interaction and  Normals

Special ConditionSpecial Condition

• When a moving ball strikes a stationary When a moving ball strikes a stationary ball of equal mass in a glancing collision, ball of equal mass in a glancing collision, the two balls move away from each other the two balls move away from each other at right angles.at right angles.

• mmaa = m = mbb

• vvaa = 0 m/s = 0 m/s

Page 99: Interaction and  Normals

Special ConditionSpecial Condition

• Use the three vectors to construct a Use the three vectors to construct a triangle.triangle.

Page 100: Interaction and  Normals

Special ConditionSpecial Condition

• Use the Use the appropriate appropriate expression to expression to determine the determine the unknown unknown variable.variable.

40sin'vm

50sin'vm

40sin'vm

90sinvm

50sinvm

90sinvm

BBAA

BBBB

AABB

Page 101: Interaction and  Normals
Page 102: Interaction and  Normals

Elastic Collision ExampleElastic Collision Example• Example: mass 1 and mass 2 collide Example: mass 1 and mass 2 collide

and bounce off of each otherand bounce off of each other• Momentum equation:Momentum equation:

• Kinetic energy equation:Kinetic energy equation:

vv11 and v and v22 = velocities before collision = velocities before collision

vv11 and v and v22 = velocities after collision = velocities after collision• Velocities are + or – to indicate Velocities are + or – to indicate

directions.directions.

'vm'vmvmvm 22112211

222

211

222

211 'vm5.0'vm5.0vm5.0vm5.0

Page 103: Interaction and  Normals

Elastic Collision ExampleElastic Collision Example

• Working with kinetic energy:Working with kinetic energy:

• 0.5 cancels out.0.5 cancels out.

222

211

222

211 'vm5.0'vm5.0vm5.0vm5.0

2

12

1

22

22

2

1

22

222

21

211

222

222

211

211

222

211

222

211

'vv

v'v

mm

v'vm'vvm

vm'vm'vmvm

'vm'vmvmvm

Page 104: Interaction and  Normals

Elastic Collision ExampleElastic Collision Example

• The velocity terms are perfect squares and can The velocity terms are perfect squares and can be factored:be factored:

aa22-b-b22 = (a – b)·(a + b) = (a – b)·(a + b)

• We will use this equation later.We will use this equation later.

'vv'vv

v'vv'v

mm

1111

2222

2

1

Page 105: Interaction and  Normals

Elastic Collision ExampleElastic Collision Example

• Momentum equation:Momentum equation:

'vv

v'v

mm

v'vm'vvm

vm'vm'vmvm

'vm'vmvmvm

11

22

2

1

222111

22221111

22112211

Page 106: Interaction and  Normals

Elastic Collision ExampleElastic Collision Example

• Both the kinetic energy and momentum Both the kinetic energy and momentum equations have been solved for the ratio of equations have been solved for the ratio of mm11/m/m22..

• Set mSet m11/m/m22 for kinetic energy equal to m for kinetic energy equal to m11/m/m22 for for

momentum:momentum: 'vv

v'v

'vv'vv

v'vv'v

11

22

1111

2222

Page 107: Interaction and  Normals

Elastic Collision ExampleElastic Collision Example

• Get all the vGet all the v11 terms together and all the v terms together and all the v22 terms terms together:together:

• Cancel the like terms:Cancel the like terms:

'vv

'v1v'vvv'v

v'vv'v

11

111

22

2222

'vvv'v 1122

Page 108: Interaction and  Normals

Elastic Collision ExampleElastic Collision Example• Rearrange to get the initial and final Rearrange to get the initial and final

velocities back together on the same velocities back together on the same side of the equation:side of the equation:

• This equation can be solved for one of This equation can be solved for one of the two unknowns, then substituted the two unknowns, then substituted back into the conservation of back into the conservation of momentum equation.momentum equation.

'v'vvv 2112

Page 109: Interaction and  Normals

Collision response: kinematic

N)( itv

)( itvN

)()( ii tvNtv

)()1()(

))(()()()( 1

ii

iiii

tvNktv

tvNktvNtvtv

k – damping factor=1 indicates no energy loss

No forces involved!

Negate component of velocity in direction of normal

Page 110: Interaction and  Normals

Collision response – penalty method

Page 111: Interaction and  Normals

Collision reactionCoefficient of restitution

N

)( itv)( itvN

)()( ii tvNtv

)()1()(

))(()()()( 1

ii

iiii

tvNktv

tvNktvNtvtv

k – coefficient of restitution

But now want to add angular velocity contribution to separation velocity

Page 112: Interaction and  Normals

Impulse response

)(tvA

)(tvB )(tB

)(tA)(txA

)(txB

How to compute the collision response of two rotating rigid objects?

Page 113: Interaction and  Normals

Impulse response

GivenSeparation velocity is to be negative of colliding velocityComputeImpulse force that produces sum of linear and angular velocities that produce desired separation velocity

Page 114: Interaction and  Normals

Rigid body simulation

relrel vv

)(tvA

)(tvB )(tB

)(tA)(txA

)(txB

BpAp

Impulse force Separation velocitytfj

Page 115: Interaction and  Normals

))((

))((1

1

jnrtI

jnrtI

M

jnvv

M

jnvv

BBBB

AAAA

BBB

AAA

)(tvA

)(tvB )(tB

)(tA)(txA

)(txB

BpAp

Update linear and angular velocities as a result of impulse force

Page 116: Interaction and  Normals

Velocities of points of contact

BBBB

AAAA

BArel

BBB

AAA

rttvtp

rttvtp

ntptpv

txpr

txpr

)()()(

)()()(

))()((

)(

)(

)(tvA

)(tvB )(tB

)(tA)(txA

)(txB

BpApAr

Br