# 3D Collision Response

This topic is 5000 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I derived an equation for calculating post collision rotation in 3D which looks a bit overworked, like maybe there's a simpler solution. w' = w + [(I^-1)((Normalize((r x N) x r)Magnitude(r)).(j)N](Normalize(r x N)) I = Inertia Tensor (3x3 matrix) r = vector to collision point from object center N = collision normal (already normalized) j = collision impulse scalar This is all based on Chris Hecker's Behind the Screen articles (http://www.d6.com/users/checker/dynamics.htm), specifically his 2D equation: w' = w + (r_|_).jN / I Where r_|_ refers to a perpendicular vector to r with length equal to r. Trying to produce this kind of vector in 3D lead to my equation above with it's normalization and the remagnituding. Is there an easier way to get the perpendicular vector to r with direction coinsiding with N and magnitude Magnitude(r)?

##### Share on other sites
Here's a picture.

I'll try to explain how I go from the concept of r_|_ to the equation above. (r1 x N) x r1 gives a vector with the right direction (think right hand rule), but the magnitude is larger than it should be (I guess the square of the target value). Hense Normalize((r x N) x r)Magnitude(r). Then multiply by I^-1 and dot that with jN per Hecker's equation. That gives the scalar manitude of the angular velocity to add. Since the product should be a vector, I multiply by Normalize(r x N), which is the direction of the angular velocity caused by an impulse to the collision point.

ps. I've check the equation with several examples like the above and kinetic energy is conservered, so there shouldn't be anything fundementally wrong with it. It's just so ugly.

[Edited by - mainline on March 14, 2005 4:14:12 PM]

##### Share on other sites
it's prety ugly, but it's accurate (if you say all checks out). the typical equation to calculate an impulse for two rigid bodies in collision is

j = -(1+Cor)(V . N)
------------------------------------------------------------------------------------------------
1/Ma + 1 / Mb + (((Ra x N) * Ia-1) x Ra) . N + (((Rb x N) * Ib-1) x Rb) . N

##### Share on other sites
Yup yup, that's what I'm using. It wasn't obvious how to add the rotational components in to the j equation, so for posterity, here's what I came up with:

j = -(1+Cor)((v1-v2)+((w1 x r1)-(w2 x r2))) . N)
----------------------------------------------------------------------------
1/Ma + 1 / Mb + (((Ra x N) * Ia-1) x Ra) . N + (((Rb x N) * Ib-1) x Rb) . N

Those r1 and r2 vectors come in handy once again. I put the equation in my simulation thingy and got some good random test data by hitting objects off of other objects (randomly). It seems robust.

[Edited by - mainline on March 16, 2005 8:07:23 AM]

1. 1
Rutin
67
2. 2
3. 3
4. 4
5. 5

• 11
• 11
• 21
• 10
• 33
• ### Forum Statistics

• Total Topics
633438
• Total Posts
3011882
• ### Who's Online (See full list)

There are no registered users currently online

×