# How to manage a survey through the travel of the mouse cursor?

Good afternoon, a question arose regarding the change of coordinates of the camera position in space.
So, that is: there is a simple demo scene in the browser where I can change the camera position and its angle of inclination.
Change position through the translation matrix of the camera (classic wasd scheme taken from games), and the inclination angle is changed by tilting to the x or y axis. The angle of inclination I is calculated using the coordinates of the cursor on the screen.
This method is good, if it were not for all browser, because it has problems:
1) Zero is counted as the point where the cursor was at the time the page is loaded. This is the small problem I have any idea how to fix it.
2) the Angle of rotation limited by screen border. Ie am getting the cursor to the border - and that's all, then I can't turn.
Tell me what else I can use to change the matrix of coordinates of the camera so that the screen does not restrict the angle of rotation? I can think of, I don't know how to call this thing, but something like "gain values to the coordinates of the cursor sent from the mouse to the system", but I don't have the slightest idea of how this is implemented and what I basically need to look for.
Implement web gl and java script.
June 10th 19 at 16:01
June 10th 19 at 16:03
I think it is necessary to describe the "acceleration" of the mouse slowly conduct - you hit the edge, and quickly pulled - spin around 360
This is an option, but I would not like to resort to it. I want to implement like in the video games do the same as we were able to solve this problem (checked the example already of the ancient classics, 1995). It remains to know how. - sanford10 commented on June 10th 19 at 16:06
June 10th 19 at 16:05
Often used:
left the book. mouse - rotate y (vertical axis),
right - rotate on x (slopes),
wheel of summing (the angle of the camera. Usually 90 gr.)
keyboard: W - move forward X - backward;
A - left, D - right (motion perpendicular to the view)
(written from memory)
Thanks, but it's a little something. I'm trying it is due to the movement of the mouse to change the coordinates of the camera sensor (in the specific case of the mouse - only the inclination). Using keys it is simple: push the button - up, but the mouse is not so trivial. - sanford10 commented on June 10th 19 at 16:08
And, Yes, you have described. From Frank moon (DirectX 12) describes the class of camera. - sanford10 commented on June 10th 19 at 16:11
Thanks , will look. - sunny commented on June 10th 19 at 16:14
June 10th 19 at 16:07
And what prevents to change the angle while holding the LMB?
For example, hold down LMB and lead the cursor to the left and the camera rotates with the inversion (right).
So in this case, it becomes very unintuitive. - sanford10 commented on June 10th 19 at 16:10
hang manul? not? - sanford10 commented on June 10th 19 at 16:13

Find more questions by tags JavaScriptAlgorithms3D