We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Issue on “single touch” panning on mobile devices and touch screens.

Home Forums General Questions Issue on “single touch” panning on mobile devices and touch screens.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #60026
    Eugene Zos
    Customer

    Hi 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.LEFT

    Any ideas? Much appreciated.

    #60029
    kdv
    Participant

    panning 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 class OrbitControls from THREE.js

    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.

    #60030
    Eugene Zos
    Customer

    Thank 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.

    #60031
    kdv
    Participant

    These two functions check the number of touches

    function onTouchStart(event)
    function onTouchMove(event)

    switch (event.touches.length)

    The functions handleTouchStartDollyPan(event) and handleTouchMoveDollyPan(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.

    #60034
    kdv
    Participant

    It appeared not so difficult ))) Just replace all mouse events with pointer events, disable rotating and swap PAN/ROTATE buttons

    https://v3d.net/9cj

    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.

    #60045
    Eugene Zos
    Customer

    Well,

    This works for me. v4 patched.

    Attachments:
    You must be logged in to view attached files.
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.