Sign in to follow this  

rotating camera from mouse

This topic is 2323 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
[/size][/color][color=#1C2837][size=2]all i need is a simple way to rotate the camera using the mouse coords
[/size][/color][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)
[/size][/color]

[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 :)[/size][/color]

Share this post


Link to post
Share on other sites
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

This topic is 2323 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this