Jump to content
  • Advertisement
Sign in to follow this  
deathwearer

DirectX and Camera rotation with Mouse

This topic is 4408 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

Hello, I'd like to know if somebody could explain me the concept of rotating the camera with the mouse. So far in my game I move around the map using asdw. Now Id like to implement the mouse to control the "head" of my character just like in FPS. The mouse is already initialized and I Aquire it. But I don't know what to do with the value return from the mouse state (DIMOUSESTATE). I save the old position and get the current position. But so far still, my math are failing to undestand how do i use the value to know where I rotate, how much i rotate. If you have any sugestion or any tutorial that would suit me very well. Thank

Share this post


Link to post
Share on other sites
Advertisement
Alright, but that still doens't help me find out how to make the movement.

I'v read this tutorial already, I just didn't see the part where it say it's hold the movement since the last call.

Share this post


Link to post
Share on other sites
Quote:
Original post by deathwearer
Alright, but that still doens't help me find out how to make the movement.

I'v read this tutorial already, I just didn't see the part where it say it's hold the movement since the last call.
The mouse 'delta x' and 'delta y' values since the last query (scaled by a 'mouse speed' factor and the time step) tell you how much relative yaw and pitch to apply to the object.

That should give you enough to go on. If it doesn't, you'll have to ask more specific questions.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!