Search the Community
Showing results for tags 'babyloninnode'.
-
As server i am using babyloninnode but i can not load any external .babylon file. For two weeks, I tried a lot to render any external babylon file on any browser but I can not . so anyone can help to solve this problem? server.js <!DOCTYPE html> <html> <head> <title>BabylonJS - Espilit demo</title> <script src="http://www.babylonjs.com/hand.minified-1.2.js"></script> <script src="http://www.babylonjs.com/Oimo.js"></script> <script src="http://www.babylonjs.com/babylon.js"></script> <style> html, body { width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden; } #renderCanvas { width: 100%; height: 100%; touch-action: none; -ms-touch-action: none; } #lcContainer { position: absolute; top: 30px; left: 30px; color: gold; } </style> </head> <body> <canvas id="renderCanvas"></canvas> <div id="lcContainer"> <ul id="listColliders"> </ul> </div> <script> var engine; var canvas; var scene; document.addEventListener("DOMContentLoaded", startGame, false); function startGame() { if (BABYLON.Engine.isSupported()) { canvas = document.getElementById("renderCanvas"); engine = new BABYLON.Engine(canvas, false); BABYLON.SceneLoader.Load("Espilit/", "Espilit.babylon", engine, function (loadedScene) { scene = loadedScene; // Wait for textures and shaders to be ready scene.executeWhenReady(function () { // Attach camera to canvas inputs scene.activeCamera.attachControl(canvas); // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function () { scene.render(); }); }); }, function (progress) { // To do: give progress feedback to user }); } } </script> </body> </html>