   Following the mouse with directx
  I just wanted to know how to make the bitmap turn in the direction of the mouse where ever you click; like in diablo 2.   
  You calculate the worlds 2d distance between the current position of the character and the position where the mouse clicked at. This gives you a 2d vector (or deltax,deltay values if you prefer).Using atan2 you can calculate the angle of this vector:float fAngleInRadian = atan2f( -deltay, deltax );float fAngleInDegree = fAngleInRadian * 180.0f / 3.1415926f;Depending on your world orientation you may have to invert deltay. According to the resulting angle you can decide which direction image gets displayed. Imagine a cake with 8 slices. Every slice refers to one direction image. If the angle lies in one of the slices you use the according image.   