Jump to content

How to work with exported scene?


kru64
 Share

Recommended Posts

I exported scene from Blender according to http://blogs.msdn.com/b/eternalcoding/archive/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender.aspx.

And now I want to add in this scene something else, for example, light.

I tried to write something like

window.onload = function(){
        if (BABYLON.Engine.isSupported()) {
            var canvas = document.getElementById("renderCanvas");
            var engine = new BABYLON.Engine(canvas, true);

            BABYLON.SceneLoader.Load("", "scene.babylon", engine, function (newScene) {
                newScene.executeWhenReady(function () {

var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(0, 100, 100), newscene);

                    // Attach camera to canvas inputs
                    newScene.activeCamera.attachControl(canvas);

                    // Once the scene is loaded, just register a render loop to render it
                    engine.runRenderLoop(function() {
                        newScene.render();
                    });
                });
            }, function (progress) {
                // To do: give progress feedback to user
            });
        }
};
 

but nothing happened. What is the right way?

 

 

 

 

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