Juncheng Posted September 12, 2017 Share Posted September 12, 2017 Hi, 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.setPosition(initCameraPostion); camera.setTarget(BABYLON.Vector3.Zero()); 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"> Quote Link to comment Share on other sites More sharing options...
ViBe Posted September 14, 2017 Share Posted September 14, 2017 Hi, Recently I read this topic : http://www.html5gamedevs.com/topic/30781-how-to-enable-touch-panning-for-arcrotatecamera/ @Kjue give a good solution for that. I don't know if it could be added to the ArcRotateCamera code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.