juanmajr93 Posted January 24, 2017 Share Posted January 24, 2017 Hi all, I want change between differents camera depends on the devices. I am developing an aplicaton web in BabylonJS and I must to define FPSCamera and TouchCamera. When this web is loaded at mobile device I have to activate the touch camera and if I visit it from pc I use FPSCamera. Do you know the way to manage it? Thanks! Quote Link to comment Share on other sites More sharing options...
davrous Posted January 24, 2017 Share Posted January 24, 2017 Hello, Use our UniversalCamera. It works on touch on mobile, with a gamepad on Xbox/PC and using keyboard/mouse on a PC: http://doc.babylonjs.com/tutorials/Cameras . All our demos on http://www.babylonjs.com are using it now. For instance, Retail: http://www.babylonjs.com/demos/retail works on touch on iPhone/Android, keyboard & mouse on PC/Mac and gamepad on Xbox One. You then have nothing else to do. Isn't that cool? David Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted January 24, 2017 Author Share Posted January 24, 2017 Yes it is so pretty!! I will Thanks you!! Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted January 27, 2017 Author Share Posted January 27, 2017 Hi all, @davrous I have tested UniversalCamera and TouchCamera with hand.js file imported. Well, both show me the same behaviour like freeCamera on PC. However the problems appear when I use an iPad to visit my application web. I cant move fast arround scene and I cant turn camera in X edge so i only move foward and back but I cant change direcction to move up or down... this is my code: var camera = new BABYLON.UniversalCamera("freeCam", new BABYLON.Vector3(600, 200, -500), scene); camera.setTarget(new BABYLON.Vector3(0,0,0)); camera.checkCollisions = true; camera.ellipsoid = new BABYLON.Vector3(2, 3, 2); camera.attachControl(canvas); You can probe this in this link: http://150.214.174.25:8029/subsuelo/ I hope your answers, thanks. Quote Link to comment Share on other sites More sharing options...
hunts Posted January 27, 2017 Share Posted January 27, 2017 @juanmajr93 have you tried camera.speed? Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted January 28, 2017 Author Share Posted January 28, 2017 hi @hunts yes I have changed speed of camera but I dont resolve problems in mobile device. Do you test this type of camera in iPad or others, I can only turn camera but I cant move arround scene. Do you know the reason? I have imported BabylonJS file from this source: https://cdn.rawgit.com/BabylonJS/Babylon.js/master/dist/preview release/babylon.js 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.