tranlong021988 Posted December 15, 2016 Share Posted December 15, 2016 Sorry, I don't have PG for this case because I see every sample work perfectly on even mobile browser. Please check http://appsbymekong.com/flashdemo/test/ It's just a simple scene with a ground. On PC, ArcRotateCamara work perfectly. But on mobile browser (my Google Nexus 6), when I slide the screen, it's just move a little bit and sometime display wrong behavior. I think that I miss something but don't know what exactly it is. Sorry for my poor English. Here my code (useless code removed): <!doctype html> <html> <head> <title>Porfolio</title> <meta name="viewport" content="width=device-width"> <style type='text/css'> html, body,canvas{ padding: 0; margin: 0; overflow: hidden; width: 100%; height: 100%; } </style> <script src="https://code.jquery.com/pep/0.4.1/pep.js"></script> <script src='http://cdn.babylonjs.com/2-5/babylon.js'></script> </head> <body> <canvas id='canvas'></canvas> <script type='text/javascript'> var canvas = document.getElementById('canvas'); var engine = new BABYLON.Engine(canvas, false); var scene = createScene(); function createScene(){ var scene = new BABYLON.Scene(engine); var rayMesh; var ambientLight = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); var light; var cam = new BABYLON.ArcRotateCamera("ArcRotateCamera", 1, 0.8, 180, new BABYLON.Vector3(0, 0, 0), scene); cam.upperBetaLimit = 2.0; cam.attachControl(canvas,false); scene.activeCamera = cam ; var ground = BABYLON.Mesh.CreateGround("ground1", 50, 50, 2, scene); return scene; } scene.registerBeforeRender(function(){ //cam.alpha+=0.01; }); engine.runRenderLoop(function() { scene.render(); }); window.addEventListener("resize", function () { engine.resize(); }); </script> </body> </html> Quote Link to comment Share on other sites More sharing options...
tranlong021988 Posted December 15, 2016 Author Share Posted December 15, 2016 Just now, max123 said: Are you using hand.js or PEP? I tried both, but still no luck. I think it can be version dependency. Quote Link to comment Share on other sites More sharing options...
max123 Posted December 15, 2016 Share Posted December 15, 2016 could it be a case of upper/lower limits? Quote Link to comment Share on other sites More sharing options...
tranlong021988 Posted December 15, 2016 Author Share Posted December 15, 2016 Just now, max123 said: could it be a case of upper/lower limits? I tried to disable all optional code, just leave basic setup but result still same. Perfectly on PC, and wrong behavior on mobile. I think I need some trick to get it working on mobile browser. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 15, 2016 Share Posted December 15, 2016 I guess you forgot to add css property to the canvas: "touch-action: none" tranlong021988 1 Quote Link to comment Share on other sites More sharing options...
tranlong021988 Posted December 15, 2016 Author Share Posted December 15, 2016 29 minutes ago, Deltakosh said: I guess you forgot to add css property to the canvas: "touch-action: none" You already save my day. Thank you !!! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Sac Posted June 16, 2017 Share Posted June 16, 2017 On 12/15/2016 at 9:24 PM, Deltakosh said: I guess you forgot to add css property to the canvas: "touch-action: none" I think, someone has to capture this in the documentation for the Cameras, where you say that we need to add the css property to the canvas:"touch-action:none" it will be very helpful then for newbies like me. Quote Link to comment Share on other sites More sharing options...
max123 Posted June 16, 2017 Share Posted June 16, 2017 Yep, this one springs up a lot I got caught out with it TWICE! Is there a reason why it's not part of the bjs framework? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 16, 2017 Share Posted June 16, 2017 Because bjs is a 3d engine 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.