   wall direction and hit angle
  i am trying to make some sliding for my game. now i figured that i should probably make the character move along the triangle with the triangle's direction,and then calculate the velocity using cos angle between original velocity and the triangle.now the problem is i am not realy sure how to calculate those.i know that i need to use the triangle's normal and the player's original velocity(by original i mean before it becomes the direction of the wall) but i am not too sure how to find that direction using these two given vectors.and i dont know how to calculate the angle between the original velocity and the triangle to determine speed.its probably vector math isnt it? i am still in highschool's 11th grade so i have'nt learned this yet.will appreciate help very much :)   
  Let v0 be your velocity.  Then the projection of v0 onto the triangle defined by n is (-n(n.v0)+v0).  You have to check magnitude/sign.   ;  wow thanks for the helpfull reply :)n is the normal right? that means negative normal multiplied by normal dot velocity(?)+velocity? that dot means dot product?   ;  correct. That will basically set your velocity to 0 along the collision normal, thus sliding on the collision plane.put it another wayv -= n * (v . n)if you want to bounce, v -= n * ((1 + cor) * (v . n))coefficient of restitution 'cor' in range [0, 1].   ;  wow thanks but ehh, both these formulas seem to not work :o   ;  If you are still having problems, can you post your code?  What problems are you having??   ;  it seems like when i colide the new velocity vector will only somehow slide on one way of the y axis(y is not height in my case),and if i try to slide on the other way it'll make the collision break and the player'll move through the collision object.i guess i can fraps this and upload to youtube if it'll help you understand what got screwed.anyway to some coding :D3DXVECTOR3 newvel = -normal*(D3DXVec3Dot(&normal,&dir))+dir;and when i tryed it your way :D3DXVECTOR3 newvel = -normal*(D3DXVec3Dot(&normal,&dir));;  I assume by dir you mean your original player velocity, and I gather that y forward along the wall, z is up, and x is into the wall.  then in this case, n = [-1,0,0].  say dir = v = [2,3,5].  then -n(n.dir)+v = [0,3,5], which is along the wall as expected.Things to check:Magnitude of normal (should be 1, otherwise things are messed up).  Sign doesn't matter.That your velocity/normal both use the same coordinate system.   ;  I wonder about operator precedence. D3DXVec3Dot(&normal,&dir) should be performed before the addition though. If your normal isn't normalised, you'll needfloat dot = D3DXVec3Dot(&normal,&dir) / D3DXVec3Dot(&normal,&normal);D3DXVECTOR3 newdir = dir - (normal * dot);;  i dont seem to have a 1 in the normal.here's the data :vertex 1 : 37.667618,3.2539771,11.949286vertex 2 : 34.011993,3.8247399,17.521290vertex 3 : 32.271404,3.2054222,22.569956these coords are pretransformed. but they seem to give same result when i transform em.normal of these 3 :x : 0.56102139y : 0.77586621z : 0.28859419dir = 0.045512982,-0.15179904-0.074233547 float dot = D3DXVec3Dot(&normal,&dir) gave me a -0.11366536D3DXVECTOR3 newdir = dir - (normal * dot) gives 0.10928168,-0.063609928,-0.041430384that seems to give the wrong result as character still seem to only walk into one way.