Slow pinch-zoom when using orthographic camera
diredev opened this issue · comments
Describe the bug
Using the pinch gesture to zoom the scene works great when using a perspective camera.
If I use the gesture with an orthographic camera however, the camera moves very slowly, making the gesture pretty much unusable.
This is easily reproducible on mobile devices, I've tested it on both on iPad Pro 11 and an Android phone.
To Reproduce
Steps to reproduce the behavior:
- Launch the "orthographic" camera example on a mobile device
- Zoom using the pinch gesture
Code
No response
Live example
No response
Expected behavior
Should zoom at a reasonable speed even in orthographic mode.
Screenshots or Video
No response
Device
Mobile
OS
MacOS, Android
Browser
Chrome, Safari
Thank you for your report.
The problem has been reproduced.
I will take a look, but sorry, I don't have much time at this moment. It may take some time.
Hi @yomotsu
I have been facing the same issue of zoom in ortho camera. Can you point me in a direction where I can take a look so that I can take a dig at this issue?
Regards
Srinivas
Hi @yomotsu
Any help on this will be appreciated!
sorry for the loooooong delay...
I checked the passed the delta value when internal zoom happens:
camera-controls/src/CameraControls.ts
Line 3239 in 92ece68
left is with a mouse wheel, and right is touch.
seems the value is not much different on both sides.
but mouse wheel events happened more frequently if my investigation is correct...
What we could do is that:
Accelerate the delta a little bit, If the internalZoom
is called from touch events.
(but not sure...
camera-controls/src/CameraControls.ts
Lines 1165 to 1200 in 92ece68
Thanks @yomotsu :) Sorry for my late reply, ill take a look based on your inputs :) I appreciate your help on this!
This helped me fix it for mobile devices. But the same pinch zoom slowness is observed when using the trackpad to pinch zoom on laptops in the orthographic mode. What solution would you suggest ?
This should definitely be configurable by a factor provided by the user. Is there any way of fixing this currently? It's quite unusable right now.
After further testing, this issue is only affecting tablets and not smartphones.