kru64 Posted December 17, 2013 Share Posted December 17, 2013 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 likewindow.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? Quote Link to comment Share on other sites More sharing options...
Temechon Posted December 17, 2013 Share Posted December 17, 2013 Hi ! Your code seems fine to me.Do you have any errors in the javascript console ?Do you have a website where your code can be tested ? Quote Link to comment Share on other sites More sharing options...
kru64 Posted December 17, 2013 Author Share Posted December 17, 2013 I tested in my localhost web made with node.js.Javacsript console says about var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(0, 100, 100), newscene)namely:"Uncaught ReferenceError:newscene is not defined". Quote Link to comment Share on other sites More sharing options...
Temechon Posted December 17, 2013 Share Posted December 17, 2013 Ok, try to replace this line : var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(0, 100, 100), newscene);by this one : var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(0, 100, 100), newScene);A typo mistake on the variable name Quote Link to comment Share on other sites More sharing options...
kru64 Posted December 17, 2013 Author Share Posted December 17, 2013 O, my god! I forgot about this stupid Java feature. Thank You so much! Quote Link to comment Share on other sites More sharing options...
Temechon Posted December 17, 2013 Share Posted December 17, 2013 No problem 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.