   velocity vector
  Hi, I am trying to simulate a collision. A particle falls down on a sphere and a collision between sphere and particle takes place. The sphere always remain stationary and the collision itself is not elastic. So if the particle falls directly n top of sphere, the velocity of particle will become zero. I was trying to set the velocity of particle to be zero after the collision. But that does not give good simulation when the collision does not occur on top of sphere but along the side of sphere.So now after the collision i need to make sure that the particle has a velocity which is orthogonal to the vector of the point of collision from the center of sphere. The velocity along the vector from center of sphere to point of collision should become zero. How do i do that?I am a bit mathematically challenged but i think it has something to do with dot product of vectors. Or maybe i am wrong :)I have the initial velocity vector and 'radiusvector' say :-1)velocity  <-1.03054, -1.56563, 1.33341e-016>  2) radius vector <2.04406, 2.19587, 1.0514>ThanksEdit: You can check the image describing the collision at http://www.freeimagehosting.net/image.php?c5ae01b476.jpgPseudo code for the problem is:-  foreach( particle particle in particlesCollections)  { //sphere.x, sphere.y sphere.z give the center of the sphere dist = particle.pos-vector(sphere.x,sphere.y,sphere.z); //detect if a collision has taken place.   if (dist.mag < sphere.radius) {rVector=dist/dist.mag*sphere.radius;    particle.pos=vector(sphere.x,sphere.y,sphere.z) + rVector;//particle.Velocity gives the velocity vector of the particle at the time of collision//i need to modify particle.Velocity so that the component of velocity that runs along // with the rvector becomes zero as i have a non elsatic collision. The remaining  //velocity that the particle will have is the one which runs along with tangent to the  //rVector. The sphere remains stationary.//example values: particle.Velocity == <-1.03054, -1.56563, .006> //and rVector = <2.04406, 2.19587, 1.0514> }    }[Edited by - khalsa on May 11, 2010 6:07:32 PM]
  reflected_velocity = velocity - 2 * radius_vector * (radius_vector dot velocity);Make sure you normalize the radius vector first though.   ;Quote:Original post by panicreflected_velocity = velocity - 2 * radius_vector * (radius_vector dot velocity);Make sure you normalize the radius vector first though.I do not want to reflect the particle. It is a non elastic collision. If the particle falls directly on top of sphere, its velocity will become zero. It is only when it strikes the side of sphere will it have a residual velocity. The component of the velocity in the direction of center of radius from point of collision will become zero and we will only have the tangential component. It is a dampening effect, not reflection!!