   How to read mouse motion
  Hi, I'm making a 3D first person shooter.Simply, I need to know how to handle input from the mouse. From what I understand the clicking of the mouse keys isn't a problem to handle (handled the same way as keyboard input with VK_MOUSER or something like that).On the other hand, I don't know how to read the "motion" of the mouse. If I knew how to get the data, I'm sure it'd be fairly simple for me to figure out how to convert it into an appropriate amount of rotation in the game.(Windows of course, and I'm working in Visual Studio 6.0). I'm assuming it'll e handled somewhere in the WndProc function, if that's what it was called, where the other inputs are handled in NeHe's tutorials.   
  The event WM_MOUSEMOVE is what you are looking for. I believe LOWORD and HIWORD provide the coords that you need.Alternatively, check out DirectInput. With this, you will get more accurate and easier to achieve input message.   ;  K, I guess I can use that.Just wondering, is there no OpenGL thing to handle this? I'm guessing no...Since I'm a bit short on time, anybody got instructions on quickly converting mouse movement to rotation?I'm guessing I store the previous coordinates and then the "velocity" of the mouse is considered a tangent to the line of sight. If I set a certain radius, where the mouse is "virtually" located in front of the camera, i can calculate the angular velocity and with that get the rotation. Is that right?More importantly, since this will be a first person shooter, will this work with mouse motion? I mean, will the mouse be able to leave the client window? If so, how do I stop it from doing this?   ;Quote:Original post by SilencedViolenceJust wondering, is there no OpenGL thing to handle this? I'm guessing no...no.  OpenGL is a graphics API.Quote:Original post by SilencedViolenceSince I'm a bit short on time, anybody got instructions on quickly converting mouse movement to rotation?[google]: Nehe OpenGL tutorial.Quote:Original post by SilencedViolenceMore importantly, since this will be a first person shooter, will this work with mouse motion? I mean, will the mouse be able to leave the client window? If so, how do I stop it from doing this?Each frame you read the new coordinate, calculate the delta, and then move the mouse back to the center of the screen.  Search http://msdn.microsoft.com for the appropriate functions and such.-me   ;  Heh thanks guys... in the end I'm just using the arrow keys to pitch and yaw since the deadline is today and half of the collision functions are still bugged.But, I will use this in further versions of the game, and it really means a lot to me, so thanks again.   