Jump to content
  • Advertisement
Sign in to follow this  
m0niSx

rotating camera from mouse

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

[color=#1C2837][size=2]hey, as the title says, ill need to rotate a game camera from the mouse mouvement
i have the mouse movement coords(X, Y)
i have the camera lookat coords
and the camera position coords
[color=#1C2837][size=2]all i need is a simple way to rotate the camera using the mouse coords
[color=#1C2837][size=2]i've already tried adding x mouvement to the X coord to the camera lookat, but at some place it stops rotation(cuz it needs to change the Y instead of the X)


[color=#1C2837][size=2]so could anyone give me an easy sample for how to apply the camera rotation porperly
any help will be appreciated :)

Share this post


Link to post
Share on other sites
Advertisement
This will depend to some degree on what type of camera, type of rotation, etc. From what I've seen, first person shooters typically reset the cursor position to the center of the screen every frame after polling its position, and rotate the camera based on the direction and distance of the polled position to the screen center. You may also want to look into arcball rotation. If neither of those suggestions help, then perhaps you could elaborate on exactly what behavior you want to achieve.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!