-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TrackballControls doesn't work correctly for touch screens #7185
Comments
It seems to happen more around the edges then a sweet spot in the middle. |
Fix for mrdoob#7185. After using two fingers, the camera would rapidly rotate if both fingers were not removed simultaneously. Adding in some state checks in `touchmove` and `touchend` prevents the jump from the null `_movePrev`, allowing users to quickly go from zooming and panning to rotating.
Fix for mrdoob#7185. After using two fingers, the camera would rapidly rotate if both fingers were not removed simultaneously. Adding in some state checks in `touchmove` and `touchend` prevents the jump from the null `_movePrev`, allowing users to quickly go from zooming and panning to rotating.
The issue seems to be related to the number of touches going from two to one. TrackballControls tries to do the typical touch rotate action on the Try my fix in #7406. Switching from multitouch to single touch works correctly in my test cases with the changes I made. |
* Removed unnecessary `default` case for two or more touches on `touchend` to prevent issues with 3 or more touches. * Reset zoom distances on `case 0` and `case 1`. I couldn't combine them easily without doing a separate `if` statement. * Simplified `case 1` action to set `_moveCurr` and `_movePrev` to the current touch position preventing camera jumping next time `touchmove` is called. Related to issue mrdoob#7185 and pull request mrdoob#7406
Sorry, I forgot to close this issue! |
Hi!
I was testing on my phone one sketch that uses the trackball control class and I realized that in most of the cases when one zooms with two fingers, as soon as the zoom event finishes, the camera performs in addition a random rotation. It seems like the zoom event produced by the two contact fingers is also triggering a rotation event.
To test it, just open the Trackball controls example with a touch device and make a couple of zooms:
http://threejs.org/examples/#misc_controls_trackball
The orbit controls work fine.
The text was updated successfully, but these errors were encountered: