Jump to content

Having problems with ArcRotateCamera after loading 3dsmax scene


manta1000
 Share

Recommended Posts

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();
                });
                });
                });   
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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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