I’m using the ArcRotateCamera, which has reliable pinch-to zoom, as well as rotation & panning. However I don’t want to rotate on a single-press, I want to pan, and I want the panning to happen on the X & Y axis, not the Z axis.
I need to have my camera pan on the X & Y axis instead of rotating around the target when the mouse button is held or a single finger is used to pan on screen. I don’t actually need rotation, but having two-finger touch rotation would be great for dev-time. I want to keep the zoom behavior.
I can’t seem to figure this out from the docs, with the only lead being hammerjs, however the example project largely is broken as far as pinch-to-zoom goes. It seems to be reinventing touch-controls, and they are not great. I also can’t make heads or tails of why some of the example code is the way it is in order to attempt to start debugging.
How can I achieve this without attempting to reinvent touch controls?
Bonus: Can the camera activity be observable? For instance to ignore/disable mesh picking while the camera is zooming or panning.
Oh this is much better! Pinch to zoom is still kind of hit or miss though, and it’s very hit or miss if using thumbs, I think it’s hitting tilt when pinching is occurring?
If tilt is disabled would pinch zooming be more reliable? In my case I don’t care much about tilt, or rotation. If I’m changing the tilt it would be zoom-level based (No free zoom, only zooming to & from preset levels).
Do you know if there is a way to “normalize” the DPI in such a way that there is little to no difference in panning speed on different devices?
@labris Thanks for the PG! It looks like the camera is panning on the Z axis as well though, instead of only panning on the XY plane?
I’ll be circling back around the touch controls after some other work, which i when I’ll give this another good try.
Yep, this was designed to be used on big touch screens. But I have an idea how to make the pinch/zoom better. I will simply not test whether in case of first double touch the distance X and Y between the touches is within the configurable pixels treshold, but I’ll check the angle between the two touches. This will be more reliable on small screens. I’m going to try it now.
This have to be fairly easy just by multiplying every movement by a DPI ratio. However I never thought of it any deeper. Not yet.
EDIT: Repo updated. Demo updated. One thing that is still missing is the distance based movement/zoom ratio.