   Given a surface normal and a direction vector, how do I reflect?
  How do I reflect a direction vector based on a surface normal?The way I'm doing it atm is this,  if SurfNorm.x<>0 DirVec=-DirVec  if SurfNorm.y<>0 dirvec=-dirvecwhich works to a degree, it always reflects, it just some times reflects in the wrong direction. it only works on 90 degree surfaces for pretty obvious reasons.Less obvious (to me) is how to reflect it properly.I have a vector lib so I can almost anything required,  I just need a pointer in the right direction please :) (Pun of course intended :P)   
  This should do the trick for perfect elastic reflection:dir -= norm * 2.0f * norm.dot(dir);If you want to know why it works its because the dot product tells you how much one vector lies in the direction of the other.  In other words its like projecting one vector onto the other and taking its projected length.  So once you know how much the direction vector is pointing in the normal direction you take twice this length off if the normal direction to reflect around the normal.  You can also model plastic reflections and any degree in between by using a number between 1.0f and 2.0f instead (where 1.0f is perfect plastic and 2.0f is perfect elastic).   