rotating camera from mouse

Started by
0 comments, last by yckx 12 years, 8 months ago
[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 :)

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.

This topic is closed to new replies.

Advertisement