Chrislistens

Members
  • Content count

    8
  • Joined

  • Last visited

  1. How to host .babylon file on web server?

    Members 0 7 posts Report post Posted 2 minutes ago Thank you Adam, I've just tried but it doesn't work...
  2. How to host .babylon file on web server?

    Thank you Adam, I've just tried but it doesn't work...
  3. Hello everybody, Does anybody have a clear and simple method to show how these 2 files attached (.html and .babylon) can be displayed on my website through Filezilla ? I searched a lot but didn't find out... Thank you in advance if you can help !!! Cheers, Chris ------------------ <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Using babylon.js - How to load a scene</title> <script src="https://cdn.babylonjs.com/babylon.max.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("", "scene2.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> babylon.html scene2.babylon
  4. Problem with babylon.sceneloader

    I also read it's necessary to change MIME types, but didn't figure out how to do that on a Mac...
  5. Problem with babylon.sceneloader

    Thanks a lot to you all for your replies! - Christoph, indeed I open the babylon.html from my disk: I'm going to try to host by a webserver, even if by now I don't know how to do it. - Deltakosh, you can find my 2 files attached. Thanks in advance!! Cheers, Chris babylon.html scene2.babylon
  6. Problem with babylon.sceneloader

    Hi Gryff, Thank you very much for your answer and the time spent ! yes I included a camera and light, and I precise the .babylon file works when I test it in Sandbox. So I still don't understand what the problem is... Thank you again! Cheers, Chris
  7. Problem with babylon.sceneloader

    Hi Gryff, Thank you very much for your answer and the time spent ! yes I included a camera and light, and I precise the .babylon file works when I test it in Sandbox. So I still don't understand what the problem is... Thank you again! Cheers, Chris
  8. Hello everybody, I created a very simple scene (1 simple sphere) with Clara.io, then exported it in .babylon format. This file is named "scene2.babylon" In my folder named "babylontest", I have 2 files : - scene2.babylon - babylon.html (code below) Would anyone know why the code below doesn't work (nothing appears when I load "babylon.html")? Is there a problem with the line "BABYLON.SceneLoader.Load("", "scene2.babylon", engine, function (newScene)" ? Thank you in advance if you can help !!! Cheers, Chris ------------------ <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Using babylon.js - How to load a scene</title> <script src="https://cdn.babylonjs.com/babylon.max.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("", "scene2.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> babylon.html