How do i find the direction of impulse in 3d?

  • Context: Undergrad 
  • Thread starter Thread starter 1101
  • Start date Start date
  • Tags Tags
    3d Direction Impulse
Click For Summary

Discussion Overview

The discussion revolves around finding the direction of impulse during collisions between spheres in a game environment, specifically addressing the complexities introduced by both linear and angular velocities. Participants explore various approaches to calculating impulse direction without needing to determine its magnitude.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes their method of calculating impulse direction by subtracting the linear velocity components of two colliding spheres, noting issues when there is no linear velocity.
  • Another participant suggests simulating forces instead of handling multiple collisions at once, proposing the use of Hooke's law and discussing the separation of motions along and perpendicular to the line connecting the sphere centers.
  • A later reply emphasizes that the direction of impulse can be simplified by assuming a collision of hard spheres with an elasticity of 1, stating that the impulse direction aligns with the line connecting the centers of mass of the spheres.
  • One participant expresses frustration with the complexity of the problem and clarifies that they only need the direction of the impulse, not its magnitude.
  • Another participant questions how the actual magnitude of the impulse is being computed, indicating potential confusion or issues with the calculations presented.

Areas of Agreement / Disagreement

Participants express differing views on the best approach to calculate impulse direction, with some advocating for a simplified model while others suggest more complex simulations. The discussion remains unresolved regarding the effectiveness of the proposed methods.

Contextual Notes

Participants assume an elasticity of 1 for the spheres, and there are unresolved questions about the implications of angular momentum and tangential forces on impulse direction. The discussion does not reach a consensus on the best method to compute impulse direction in all scenarios.

1101
Messages
23
Reaction score
0
I'm writing a game that involves collisions with spheres. Anyway each sphere has both angular and linear velocity. These two spheres collide. I need to find the direction of the impulse between them (if that's the right wording). I tried just subtracting their linear velocity components like this:

implusex = sphere1xspeed - sphere2xpseed;
implusey = sphere1yspeed - sphere2zpseed;
implusez = sphere1zspeed - sphere2zpseed;
(at which point I would then normalize the vector)

This seems to work for calculating the linear velocity after the collision but what happens is that the magnitude of the impulse is 0 when there is no linear velocity. This creates a problem with things like gears which may be locked into a fixed location in space but have angular velocity.

I should point out that since I'm working in a game environment I do not know what the final linear/angular velocity of the spheres is.

I'm using the formula found here to calculate the magnitude of impulse and do other physics things: http://www.euclideanspace.com/physics/dynamics/collision/threed/index.htm
 
Physics news on Phys.org
If you have possibility of more than one collision at a time, I'd go with simulating forces instead and run collisions step-by-step. Just assume Hooke's law between them, and go with it. There are some pitfalls in that too, which I can tell you how to get around once you find problems, but it's still easier than trying to solve a multiple-collision.

Otherwise, if you prefer to do collision at-once, you need to consider two motions separately. The motion along the line connecting centers and motion perpendicular to it.

Motion along the line is a simple 1D collision. You'll need some sort of coefficient telling you how elastic collision will be, and then solve for conservation of momentum and energy loss appropriate for your coefficient.

The tangential component is more complicated if you want the spheres to have spin and surface friction. This is another reason to run it step-by-step. You can then just take force between spheres, use it as normal force, and with coefficient of friction figure out what the tangential force at the surface is.

I'd have to think about it a while to tell you how, or even if, it can be done in collision at-once. (It simply isn't done that way, normally, so I'd have to derive a few things from scratch.)

Edit: If you want, I can send you a source code for a simple pool simulation I wrote some time ago. It's not very clean, but it works, and you might pick up a few useful things from it.
 
You understand that all I need to find is the direction of the impulse right? I don't need the magnitude. Also really don't want any source code to spend hours digging through. This is evidently much hard than I thought. Also I'm just assuming everything has an elasticity of 1.
 
Heh. Can't blame you for not wanting to read the code.

Alright. If you assume a collision of two hard spheres with elasticity of 1, this problem can be greatly simplified.

Basically, you can disregard any tangential forces. Both spheres will preserve their angular momentum, and therefore their original angular speed.

The direction of impulse is then simply along the line that passes through centers of mass. So impulse for sphere 1 will have direction:

I_x = x_1 - x_2
I_y = y_1 - y_2
I_z = z_1 - z_2

Properly normalized, of course, as you originally suggested.

The actual speeds will only matter as far as magnitude of the impulse, not direction.
 
Are you sure? It doesn't seem to be working right
 
How are you computing the actual magnitude of the impulse?
 

Similar threads

  • · Replies 138 ·
5
Replies
138
Views
9K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 25 ·
Replies
25
Views
10K
  • · Replies 60 ·
3
Replies
60
Views
7K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 35 ·
2
Replies
35
Views
5K