mouse in directx : direction of movement
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 ..
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
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
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement