Home › Forums › General Questions › Issue on “single touch” panning on mobile devices and touch screens.
- This topic has 5 replies, 2 voices, and was last updated 2 years, 9 months ago by
Eugene Zos.
-
AuthorPosts
-
2023-01-30 at 4:34 pm #60026
Eugene ZosCustomerHi all,
I was able to “patch” v3 for a single touch camera pan (Pseudo-2D map explorer) But since v4, I cannot achieve this anymore. As UX goes, not sure many people would assume they need to use two fingers to pan the map. I’ve swapped the mouse pan to the left button, but touch controls are nowhere to be found. Is there a way to remap touch controls in code?
For mouse pan
v3dApp.controls.mouseButtons.PAN = v3d.MOUSE.LEFTAny ideas? Much appreciated.
2023-01-30 at 5:17 pm #60029kdv
Participantpanning with the left mouse button (rotating is disabled)
app.controls.enableRotate = false; app.controls.mouseButtons.PAN = 0; app.controls.mouseButtons.ROTATE = 2;but touch controls are nowhere to be found
Panning and zooming are triggered only when the second touch event occures. To force panning instead rotating you need to patch
v3d.js(it’s a little complicated task) or you can use the separate classOrbitControlsfrom THREE.jsPuzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-01-30 at 5:31 pm #60030
Eugene ZosCustomerThank you,
I did patch v3d.js in v3, but seems like v4 is quite different and my old solution is no longer viable. I’ll dig more, cheers.2023-01-30 at 5:45 pm #60031kdv
ParticipantThese two functions check the number of touches
function onTouchStart(event) function onTouchMove(event)switch (event.touches.length)The functions
handleTouchStartDollyPan(event)andhandleTouchMoveDollyPan(event)require the second touch event and they will throw an error if you try to call them with a single touch only.Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-01-30 at 7:06 pm #60034kdv
ParticipantIt appeared not so difficult ))) Just replace all
mouseevents withpointerevents, disable rotating and swapPAN/ROTATEbuttonsPuzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-01-31 at 11:53 am #60045
Eugene ZosCustomerWell,
This works for me. v4 patched.
-
AuthorPosts
- You must be logged in to reply to this topic.


