Search the Community
Showing results for tags '.babylone simple view viewer'.
-
Hi all, Im so beginner with babylon.js and im trying to do a simple example to view .babylone file with a code that i found in some sites, but it didnt work with me. i tryed to view the Windows cafe example (wcafe.babylon) founded in sence folder with this code that i placed in the same folder with babylon.1.9.0.js file <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>Using babylon.js - How to load a scene</title> <script src="babylon.1.9.0.js"></script> <style> html, body { width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden; } #renderCanvas { width: 100%; height: 100%; } </style></head><body> <canvas id="renderCanvas"></canvas> <script> if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("", "WCafe.babylon", engine, function (newScene) { // Wait for textures and shaders to be ready newScene.executeWhenReady(function () { // 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 }); }</script> </body></html>So, is there anything to do with the "wcafe.babylon" file or the problem is from code? PS: i use apache server to test it and sorry for my Englesh