-
-
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
Controls Zoom & Pan Bug on Touch Devices #27073
Comments
On the other hand, when I add the second pointer, it should call |
In general, the controls add pointers sequentially in the same order I think you are referring to the situation when one pointer is active, a second pointer is added which leads to a state transition. According to the default touch configuration you switch from If you want to disallow state transitions in certain cases, you need something like a timeout in which additional pointer downs are valid and lead to another state. When the time has passed though, additional pointer downs do not change the state anymore. Would something like this fix the issue for you? |
Interesting idea, thanks, I will check that out tonight. It might be on the technical side the intended behaviour if it is that state switching, but on the UX side you will see some jumped zooming/panning/rotating that makes the controls look bugged. This is not only happening when you follow the path from one pointer panning to two pointer zoom, but when you have a large screen with not the best touchscreen, ghost touching will do this also unintentionally. But I also know that even if it is smoothening the controls out it might be considered as an add on and I've read your opinion in multiple PRs about the simplicity and basic structure that is the intention of the codebase of three.js 😅 |
This is the current behaviour which I would not consider as intentional. Used standard OrbitControls in its (almost) preconfiguration and TrackballControls for zoom with damping. lv_0_20231030105457.mp4But the users say they want a behaviour like in Google or Apple Maps, which is why I make a custom OrbitControls with a threshold for tilting with two pointers, circular rotation and this is where I saw, that google maps does not have this jumping effect while switching state from one active to two active pointers. Btw it would be lovely to have this kind of control behind MapControls which I was hoping to find, not just another setup of OrbitControls^^ 😅 |
If you have a solution, it would be interesting if you could share it here. In this way, we can evaluate its behavior and complexity. This would also make it easier to compare the current state and the fixed one which makes it easier to justify a breaking change/change in behavior. |
Description
When you have one touch point, move this touch point by a larger distance and than add a second touch point without releasing the first, depending on the configuration, dolly/zoom, pan or rotate is triggered in OrbitControls and TrackballControls (+MapControls).
This looks buggy, as the user is not intended to already trigger the controls. This is happening especially in the use-case when you configure
controls.touches.ONE = TOUCH.PAN
andcontrols.touches.TWO = TOUCH.DOLLY_ROTATE
and when you are panning with one finger and then want to zoom on an object without touchending all touchpoints.You can see the issue in the basic configurations as well. I don't see this effect on Google Maps or Apple Maps.
I think to change this, one would need to update the dollyStart/panStart with the current position of pointer 1
pointerPosition[pointer[0].pointerId]
if a second pointer is added, so that there is no dollyDelta or panDelta. I guess the location is assigned to dollyStart once the touchstart is triggered, which is the wrong position if you have moved meanwhile to calculate a correct delta.Reproduction steps
Code
Live example
TrackballControls
Screenshots
No response
Version
r158
Device
Desktop, Mobile
Browser
Chrome, Firefox, Safari, Edge
OS
Windows, Android, iOS
The text was updated successfully, but these errors were encountered: