- #1
shadow12345
- 9
- 0
I am writing a physics modeling program which simulates rigid bodies in a 3D world. I've come across the problem of properly implementing friction.
In general, the magnitude of the friction force is the friction coefficient times the magnitude of the normal force, and the friction force points in the direction opposing the tangential velocity of the contact point (the point of contact between the colliding bodies. In the computer program, only one contact point is taken into account when in reality when objects collide they do so over an area).
Friction = u * Normal
Now, I know the magnitude of the normal force (the impulse force, in this case). The problem I am running into is when objects come to a complete stop. You see, friction opposes the motion, but it cannot ever *reverse* the direction of motion. Handling friction for spheres that do not rotate, but just slide across a 0 degree incline, is a relatively easy problem. However, I have run into tons of problems for solving for the friction force for spheres that have both linear and angular motion. For right now, all spheres just collide with the earth, which has no motion and 'infinite' mass. I've chosen specific coefficients of friction which correspond to rubber on concrete. Because this is a computer program, static friction doesn't exist (rather, dynamic friction brings objects to rest and keeps them there). Here is the general algorithm for handling friction during an impulse:
-Compute the magnitude of the normal impulse (this works, I've implemented this for spheres that collide with other spheres, and is based on the relative normal velocity and the coefficient of restitution of the collision)
-Apply the tangential impulse force
-Check to see if the tangential velocity has been reversed. If it has, then that means I need to solve for a new friction force whose magnitude is less than the original friction force, but great enough to bring the relative velocity to zero.
edit:
What I've tried to do is resort to using energy methods, as that is the only way to relate linear motion and angular motion. Kinetic energy is in the same units, Joules, regardless of the type of motion it arises from, where as angular momentum is not in the same units as linear momentum. Subsequently, there is no way I can sum the linear and angular momentum in the tangential direction, and then compute a friction change in momentum (an impulse force, because a force is the time derivative of momentum, but because this is a computer simulation we take the limit of this such that the change in time approaches zero, and all forces are seen strictly as changes in momentum).
What I've tried to do is instead compute the amount of kinetic energy which stems from the tangential motion of the object. From that, I can compute the amount of negative work that needs to be done by the friction force to bring the relative tangential velocity to zero. It is negative work because friction works against the motion of the object.
In general, the magnitude of the friction force is the friction coefficient times the magnitude of the normal force, and the friction force points in the direction opposing the tangential velocity of the contact point (the point of contact between the colliding bodies. In the computer program, only one contact point is taken into account when in reality when objects collide they do so over an area).
Friction = u * Normal
Now, I know the magnitude of the normal force (the impulse force, in this case). The problem I am running into is when objects come to a complete stop. You see, friction opposes the motion, but it cannot ever *reverse* the direction of motion. Handling friction for spheres that do not rotate, but just slide across a 0 degree incline, is a relatively easy problem. However, I have run into tons of problems for solving for the friction force for spheres that have both linear and angular motion. For right now, all spheres just collide with the earth, which has no motion and 'infinite' mass. I've chosen specific coefficients of friction which correspond to rubber on concrete. Because this is a computer program, static friction doesn't exist (rather, dynamic friction brings objects to rest and keeps them there). Here is the general algorithm for handling friction during an impulse:
-Compute the magnitude of the normal impulse (this works, I've implemented this for spheres that collide with other spheres, and is based on the relative normal velocity and the coefficient of restitution of the collision)
-Apply the tangential impulse force
-Check to see if the tangential velocity has been reversed. If it has, then that means I need to solve for a new friction force whose magnitude is less than the original friction force, but great enough to bring the relative velocity to zero.
edit:
What I've tried to do is resort to using energy methods, as that is the only way to relate linear motion and angular motion. Kinetic energy is in the same units, Joules, regardless of the type of motion it arises from, where as angular momentum is not in the same units as linear momentum. Subsequently, there is no way I can sum the linear and angular momentum in the tangential direction, and then compute a friction change in momentum (an impulse force, because a force is the time derivative of momentum, but because this is a computer simulation we take the limit of this such that the change in time approaches zero, and all forces are seen strictly as changes in momentum).
What I've tried to do is instead compute the amount of kinetic energy which stems from the tangential motion of the object. From that, I can compute the amount of negative work that needs to be done by the friction force to bring the relative tangential velocity to zero. It is negative work because friction works against the motion of the object.
Last edited: