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.
I think it is necessary to describe the "acceleration" of the mouse slowly conduct - you hit the edge, and quickly pulled - spin around 360
sunny answered on June 10th 19 at 16:05
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)
skye.Satterfield72 answered on 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).