   Collision Response, calc sliding plane
  Hi!I have all Collision Detection sorted out for my First Person Shooter game.My game is build up by "lines" that are walls with two vectors at the start and end.I use a sphere, so this should be pretty easy.One calculation that i use so the player slides along the walls is:if (distance_to_wall < min_distance) if (player_is_facing_wall)    find out how much "too close" we are the wall, take the walls normal *   distance we have moved to close.this will make the player slide along the wall, but the corners are not nice, this gives jerky sliding, the player gets out if we slide to a obtuse corner.I think i need some other algorithm for smoother sliding. Looking att this tutorial: http://www.peroxide.dk/download/tutorials/tut10/pxdtut10.htmlBut i can´t figure out what is ment with "the sliding plane"?Can anyone explain the collision response part of the sliding plane?If anyone is interested i can send my code of the game (very simple clean code with just collisiondetection) to help me out fixing this problem.What algorithm do you use for sliding (Collision response)?   
  collision response relies on a few parameters to compute a response. Points of contact, normal of collision, time of collision... The normal of collision is the normal of the 'sliding plane'. when you collide with a corner, the normal of collision would go from the vertex you collide with, towards the centre of your sphere. That normal defines the sliding plane, which way the ball would slide when hitting the corner. to slide, you remove all components of the velocity along the normal of the sliding plane (normal of collision). v -= n * (v . n)That's about it really. the 'sliding' plane is the collision plane. If you hit a flat surface, the collision plane will be the surface itself. If you hit a vertex, the imaginary collision plane would have its normal pointing towards the centre of the sphere. That's how you get smooth response around corners.you can put the algorithm in general form when you want to slide a sphere with any surface. 1) find closest point on surface to sphere centre. 2) compute the normal of collision :    -> n = (sphere_centre - closest_point).normalised()3) slide velocity :    -> sphere_velocity -= n * (sphere_velocity.dotProduct(n));;  Thanks mate! for once i really understand what you mean.Only one more question!The sphere velocity?? is this the movement vector?Now when colliding i ONLY use the 90degree normal of the walls for pushing sphere out from plane, this gives problem around edges. i sent you a private mail, but i think this will answer the question.If i get really desperate maybe you could hook up a demo like your other 2D applications you have done (really nice btw) PollyColly3, PollyColly4 etc with a demo of just a sphere sliding agaings walls of a polygon. both obtuse and non-obtuse angles between walls.tnx again.   ;Quote:The sphere velocity?? is this the movement vector?velocity, displacement vector, movement vector, they are all kind of the same think, and they are the vector that provide the sliding. Quote:Now when colliding i ONLY use the 90degree normal of the walls for pushing sphere out from plane, this gives problem around edges. Well yes, the fact that you use the wall normal even when the sphere hits a corner is your problem. Quote:If i get really desperate maybe you could hook up a demo like your other 2D applications you have done (really nice btw) PollyColly3, PollyColly4 etc with a demo of just a sphere sliding agaings walls of a polygon. both obtuse and non-obtuse angles between walls.I can do that easy enough. There are two techniques though, one that works with just intersections, one that works with moving spheres, which is obviously more complicated. ;  i would be very glad for the easy one. just so a sphere can slide along different walls (lines), both obtuse and not-obtuse angles of the walls.I am implementing your code, and i am there just 99%.so far i have this.-> n = sphere_centre - closest_point).normalized()while(player_too_close) {D3DXVECTOR3 n;D3DXVec3Normalize(&n,&(_camera.mPos - planes.ClosestPoint(_camera.mPos)));//Just how far to push spherer out.float pushOut = min_distance_to_wall - D3DXVec3Length(&vLength);_camera.MoveCamera(n*pushOut);}//This code works all but when sliding through corners that are convex (the player stops sliding when close to wall in the corner)but i can´t figure out the next line?? (-> sphere_velocity -= n * (sphere_velocity.dotProduct(n));How can i code this in c++? D3d?