manta1000 Posted July 7, 2015 Share Posted July 7, 2015 Hi all.I am quite new to Babylon.js as well as Javascript so I guess this problem I have has a simple solution but I have been trying for a few hours now without success. I have a simple SceneLoader.Load routine to load a 3dsmax scene into my project, the scene contains a few meshes a light and a camera. All I wish to do is implement an ArcRotateCamera using the Betalimit and Alphalimit for restrictions but I can't seem to get it to move at all, so obviously I am doing something wrong, if anyone can point me in the wright direction I would be very grateful. Here is the code I am using. BABYLON.SceneLoader.Load("scenes/", "test.babylon", engine, function (scene) { scene.executeWhenReady(function () { var camera = new BABYLON.ArcRotateCamera("camera", 130.4, 1.3, 120, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, true); scene.lights[0].intensity = 1.2; // Add shadows var shadowGenerator = new BABYLON.ShadowGenerator(2048, scene.lights[0]); for (var i = 0; i < scene.meshes.length; ++i) { shadowGenerator.getShadowMap().renderList.push(scene.meshes); shadowGenerator.setDarkness(0.8); scene.meshes.receiveShadows = true; }; camera.lowerBetaLimit = 1.2; camera.upperBetaLimit = 1.4; camera.lowerAlphaLimit = 129.9; camera.upperAlphaLimit = 130.9; // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function() { scene.render(); }); }); }); Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 7, 2015 Share Posted July 7, 2015 Hey! and welcome! Has your initial scene a camera? if yes then add scene.activeCamera = camera to switch to your camera Other idea: ALpha and beta are radians (between -3.14 and 3.14) Quote Link to comment Share on other sites More sharing options...
manta1000 Posted July 8, 2015 Author Share Posted July 8, 2015 Thanks for replying Deltakosh that seemed to do the trick, I knew it had to be something simple lol, thanks again for your help. 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.