mouse in directx : direction of movement

Started by
2 comments, last by ilimo 20 years, 3 months ago
hello, how get the direction of mouvement when moving the mouse ? using directx (9) ? perhaps using DIMOUSESTATE , but i don''t know how.. this is for a camera move ... thank you for your help ..
Advertisement
DIMOUSESTATE has lX, lY, and lZ members in it (lZ is commonly for the mouse wheel). With a mouse, these members describe the amount of change, not the actual position.

If lX is less than zero, the user is moving their mouse left, and if greater than zero, they are moving their mouse right (IIRC). If lY is less than zero, the user is moving the mouse down, but if it''s greater than zero, it''s being moved up
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
turning left i can,
but turning right i can not..
any idea..?
position.x = (view.x + distance*sinf(rotationY)*sinf(rotationX));position.z = (view.z + distance*cosf(rotationY)*sinf(rotationX));position.y = -(view.y + distance*cosf(rotationX)); 
This is part of my camera code... position is a vector for the position of the camera. view is a vector for the spot you are looking at with the camera. rotationX/rotationY are their respective changes in mouse movement. Copy and paste at your own risk.

[edited by - Raloth on January 17, 2004 1:01:16 AM]
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...

This topic is closed to new replies.

Advertisement