Jump to content

How to touch pan the arcRorateCamera on Mobile


Recommended Posts


I have a question. How to touch pan the mesh in canvas?

I have a setup with an arcRotateCamera and pep.js. On the desktop, the panning with right click on mouse works fine. On the mobile, one finger rotation and pinch zoom worked, but two fingers panning is not working. I am not proficient with web developing, hope I could get some ideas from you guys. Thanks!

The code snippet for the camera:

// the camera
camera = new BABYLON.ArcRotateCamera("Camera", 1.575, 0.75, 20, BABYLON.Vector3.Zero(), scene);
camera.inertialRadiusOffset = 0;
camera.allowUpsideDown = false;
camera.pinchPrecision = 5;
camera.wheelPrecision = 10;
camera.fov = 0.01;
camera.panningSensibility = 500;
camera.panningInertia = 0.1;

scene.activeCamera = camera;
scene.activeCamera.attachControl(canvas, false, false);

The code snippet for canvas and pep:

<!-- import pep.js -->
<script src="https://code.jquery.com/pep/0.4.3/pep.js"></script>

<!-- canvas -->
<canvas class="myCanvas" style="user-select: none;" id="myCanvas-Modal" touch-action="none">


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...