
A question about reflections, with a diagram!

You can decompose crazy bob''s velocity into components perpendicular and parallel to the normal at the point of impact. The parallel component will be unaffected by the impact while the perpendicular component will be reversed. If n is the unit normal and v is the velocity then (v.n)*n is the component parallel. The component parallel and the component perpendicular sum to the velocity vector. So you subtract the component parallel twice to reverse it, i.e. 1-2=-1.
Keys to success: Ability, ambition and opportunity.
I'll just supplement LilBudyWizer's post by adding that if you want to have a more realistic bounce you can can reduce the magnitude of the reversed normal component to account for an imperfect collision, e.g., apply a coefficient of restitution less than 1. Also, you can add the effect of friction by reducing the tangential component of velocity. Thus, the object will slow down both tangentially and normally during the collision. A further thing you could to do add realism would be to apply a torque to the object for a couple of frames based on the friction force encountered while it is in contact with the terrain. These are a bit advanced, but its not too difficult to add quick-and-dirty approximations to them and the result can be quite nice for some games. A few links:
This one is a very good place to look to get a better understanding of what I'm trying to say:
carini.physics.indiana.edu/E105/spin-and-collisions.html
Some others:
Coefficient of restitution/imperfect collisions:
scienceworld.wolfram.com/physics/CoefficientofRestitution.html
Kinetic Friction:
scienceworld.wolfram.com/physics/KineticFriction.html
For a quick-and-dirty solution, you can just assume that the friction and coefficient of restitution effects do not interact in any way.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
[edited by - grhodes_at_work on January 27, 2003 12:02:33 PM]
This one is a very good place to look to get a better understanding of what I'm trying to say:
carini.physics.indiana.edu/E105/spin-and-collisions.html
Some others:
Coefficient of restitution/imperfect collisions:
scienceworld.wolfram.com/physics/CoefficientofRestitution.html
Kinetic Friction:
scienceworld.wolfram.com/physics/KineticFriction.html
For a quick-and-dirty solution, you can just assume that the friction and coefficient of restitution effects do not interact in any way.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
[edited by - grhodes_at_work on January 27, 2003 12:02:33 PM]
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Me physics isn''t to strong, but say you apply friction. Is it just a fixed multiplier to the tangential component or does it depend upon the angle of collision? Well, the percentage change in velocity is dependant either way, but hopefully you know what I mean.
Keys to success: Ability, ambition and opportunity.
Friction is not meaningful when considering collisions (unless you''re thinking about rotation). Imperfect collisions are a good thing to implement, but easy to fake; just multiply the perpendicular vector by some number -1 < n < 0, instead of -1.
Don''t listen to me. I''ve had too much coffee.
Don''t listen to me. I''ve had too much coffee.
quote:
Original post by LilBudyWizer
Me physics isn''t to strong, but say you apply friction. Is it just a fixed multiplier to the tangential component or does it depend upon the angle of collision? Well, the percentage change in velocity is dependant either way, but hopefully you know what I mean.
A fixed multiplier would be a very good fake friction effect for many games. You might even make the multiplier a linear function of the collision velocity. In reality, its more complex. For a rigid body the friction force could be modeled using a Coulomb friction model, which says the friction force that reduces the tangential velocity is equal to a friction coefficient times the normal direction reaction force applied between the colliding object and the wall. And that normal force is a function of collision angle. For a simulation, you''d assume the friction force acts for the entire time frame, and to determine the change in velocity you''d just apply that deceleration in the tangential direction using the usual Newton''s 2nd law of motion (F = ma integration).
In reality, objects are not purely rigid and the friction effect is quite complex. The flexing of the object, a function of the material and inertia properties, collision angle, collision angle, etc.. And the friction is a function of the flexed shape. The friction actually isn''t even constant over the contact area, and it also varies continuously over time so the idea of holding friction constant over a frame is not really reality. The object shape will actually vibrate for a period of time, and both the n ormal force and friction are varying in an oscillatory fashion throughout the collision. But for games, all this stuff is way overkill. For now. In ten years, who knows?
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement