Jump to content
  • Advertisement
Sign in to follow this  
jagguy2

mouse move

This topic is 3820 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

q)i want to move my mouse with my directx/c++ program. How can i detect mouse movements so i can move the camera? i have to move the camera not only left or right but up and down . q) how can i click on an object with a mouse and get the 3d coordinates?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by jagguy2
q)i want to move my mouse with my directx/c++ program. How can i detect mouse movements so i can move the camera?

i have to move the camera not only left or right but up and down.
WM_MOUSEMOVE, or raw input if you really need high resolution mouse input. Don't use DirectInput for it.

Quote:
Original post by jagguy2
q) how can i click on an object with a mouse and get the 3d coordinates?
Google for "picking", or look at the "Pick" sample in the SDK.

Share this post


Link to post
Share on other sites
Quote:
Original post by jagguy2
ok can i simply detect mouse movement like a key input?
Yup. Your window gets sent WM_MOUSEMOVE messages, which contain the current position of the mouse pointer (in client coordinates). You might want to use SetCapture() to capture mouse input when it's not in your client area, depending on what you're doing.

Share this post


Link to post
Share on other sites
I used this code for a left key mouse

q) is this the best way to test key input? isnt there a directx way?


if (GetAsyncKeyState(VK_LBUTTON))
{

GetCursorPos(&pt);
ScreenToClient(hWnd, &pt);

}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!