Skip to main content
GameDev.net gamedev.net
🔒 Locked

rotating camera from mouse

Started by m0niSx Aug 8, 2011 at 3:48 AM 0 replies 1.1k views
Original Post
m0niSx
m0niSx
[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

yckx
yckx
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.