danielvh96 Posted May 26, 2014 Share Posted May 26, 2014 I have a problem, the file location is correct. I use everything in the same folder now and the babylon file is namen scene.babylon, all I see is a white screen and nothing happens :/ It isn't an empty file because the sandbox displays everything correctly.. Please Help! Quote Link to comment Share on other sites More sharing options...
Kilombo Posted May 26, 2014 Share Posted May 26, 2014 Hello, and welcome aboard. Can you post some code plz, or a jsfiddle ? Quote Link to comment Share on other sites More sharing options...
gwenael Posted May 27, 2014 Share Posted May 27, 2014 Hello, Did you manage to play with demos on babylonjs.com?Do you a use a local server to serve your files? You can use IIS on Windows with https://github.com/BabylonJS/Babylon.js/tree/master/Tools/BuildOurOwnBabylonJS or another server, it's up to you. Quote Link to comment Share on other sites More sharing options...
danielvh96 Posted May 27, 2014 Author Share Posted May 27, 2014 I do use a local host on visual studio. This is the code that I use:<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>Using babylon.js - How to load a scene</title> <script src="hand.js"></script> <script src="babylon.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("", "scene.babylon", engine, function (newScene) { 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> Quote Link to comment Share on other sites More sharing options...
gwenael Posted May 27, 2014 Share Posted May 27, 2014 Any error in the javascript console? Quote Link to comment Share on other sites More sharing options...
danielvh96 Posted May 27, 2014 Author Share Posted May 27, 2014 Uncaught Error: 404 In the babylon.js file. Here is an screen capture http://prntscr.com/3n1dvu Quote Link to comment Share on other sites More sharing options...
danielvh96 Posted May 27, 2014 Author Share Posted May 27, 2014 Just read something about adding some script to your web.config file. Here is the code I currently use but what do I have to add?<?xml version="1.0"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" /> </system.web></configuration> Quote Link to comment Share on other sites More sharing options...
Staafsak Posted May 27, 2014 Share Posted May 27, 2014 . Quote Link to comment Share on other sites More sharing options...
davrous Posted May 27, 2014 Share Posted May 27, 2014 Try to add that to your web.config file:<system.webServer> <staticContent> <mimeMap fileExtension=".fx" mimeType="application/fx" /> <mimeMap fileExtension=".babylon" mimeType="application/babylon" /> <mimeMap fileExtension=".babylonmeshdata" mimeType="application/babylonmeshdata" /> </staticContent></system.webServer> babaorhum 1 Quote Link to comment Share on other sites More sharing options...
danielvh96 Posted May 27, 2014 Author Share Posted May 27, 2014 Thank you guys for all the help!! Worked for me Thanks a lot man I really appreciate it! Quote Link to comment Share on other sites More sharing options...
hit2501 Posted December 2, 2014 Share Posted December 2, 2014 I have the same problem, where is web.config or I must create it?, sorry if its too obvious but Im new on babylon. Thank you. Quote Link to comment Share on other sites More sharing options...
gwenael Posted January 25, 2015 Share Posted January 25, 2015 Hi hit2501, Which server do you use? Quote Link to comment Share on other sites More sharing options...
ZenZoy Posted January 15, 2016 Share Posted January 15, 2016 hey yall, even with darvous' suggested changes I still get a 404 error. any idea why? :/ Quote Link to comment Share on other sites More sharing options...
Temechon Posted January 15, 2016 Share Posted January 15, 2016 Hey, Maybe you can share some code ? Hard to say where's the mistake without seeing anything Quote Link to comment Share on other sites More sharing options...
ZenZoy Posted January 15, 2016 Share Posted January 15, 2016 I could see it ll be a bit tricky to debug without seeing any code!! just didn't wanna flood with any code but couldn't import my mesh on playground either! sophei's choice! so here it is ... function startBabylonJS() { if (BABYLON.Engine.isSupported()) { scene = createScene(); BABYLON.SceneLoader.ImportMesh("", "scenes/", "Rabbit.babylon", scene, function (newMeshes) { // Set the target of the camera to the first imported mesh camera.target = newMeshes[0]; }); engine.runRenderLoop(function () { scene.render(); }); window.addEventListener("resize", function () { engine.resize(); }); } } function createScene() { canvas = document.getElementById('renderCanvas'); engine = new BABYLON.Engine(canvas, true); scene = new BABYLON.Scene(engine); camera = new BABYLON.ArcRotateCamera("camera", Math.PI, Math.PI / 2, 10, BABYLON.Vector3.Zero(), scene); sun = new BABYLON.HemisphericLight("sunLight", new BABYLON.Vector3(0, 1, 0), scene); camera.checkCollisions = true; camera.attachControl(canvas); return scene; } and i have a basic wen.config like this: <?xml version="1.0" encoding="utf-8"?> <configuration> <!--<system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" /> </system.web>--> <system.webServer> <staticContent> <mimeMap fileExtension=".fx" mimeType="application/fx" /> <mimeMap fileExtension=".babylon" mimeType="application/babylon" /> <mimeMap fileExtension=".babylonmeshdata" mimeType="application/babylonmeshdata" /> </staticContent> <handlers> <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" /> </handlers> <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" forwardWindowsAuthToken="false" startupTimeLimit="3600" /> </system.webServer> </configuration> thanks in advance Quote Link to comment Share on other sites More sharing options...
Temechon Posted January 15, 2016 Share Posted January 15, 2016 A 404 error can be displayed in the console if the file Rabbit.babylon.manifest is not found. Is it the case for you ? In this case, it can be ignored, and I suggest you to read this article about this: http://doc.babylonjs.com/tutorials/07._Caching_Resources_in_IndexedDB Anyway, your code should be working. If you add this: BABYLON.SceneLoader.ImportMesh("", "scenes/", "Rabbit.babylon", scene, function (newMeshes) { // Set the target of the camera to the first imported mesh camera.target = newMeshes[0]; console.log(newMeshes); }); Do you have anything shown in the console? Can you see the rabbit ? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 15, 2016 Share Posted January 15, 2016 You can also use this property to eliminate errors when you are not using manifest files. engine.enableOfflineSupport = false; Quote Link to comment Share on other sites More sharing options...
ZenZoy Posted January 15, 2016 Share Posted January 15, 2016 yeah, I was not counting the manifest file 404 I still can't see the rabbit, nothing gets printed out to the console other than GET http://localhost:59991/scenes/Rabbit.babylon 404 (Not Found)h @ babylon.2.2.js:4r.LoadFile @ babylon.2.2.js:4c @ babylon.2.2.js:20t @ babylon.2.2.js:3(anonymous function) @ babylon.2.2.js:3 babylon.2.2.js:4 Uncaught Error: Error status: 404 - Unable to load ../scenes/Rabbit.babylone.onreadystatechange @ babylon.2.2.js:4 it makes me wonder if there is any other visual studio environment setting that is not allowing for this babylon file to be visible ... Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 16, 2016 Share Posted January 16, 2016 you have a link to your scene. Your error indicates a bad path to your babylon file. Check that the folder where the file "Rabbit" is, is named scenes and not scene. Check that the path is correct. Quote Link to comment Share on other sites More sharing options...
ZenZoy Posted January 16, 2016 Share Posted January 16, 2016 the path is "scenes" and the folder is called scenes as well... I have tried every combination of path and all sorts of babylon files... none of them work !! :)) sth strange is going on!! ill figure it out ... eventually! Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 16, 2016 Share Posted January 16, 2016 You have a zip file containing your scene, I'll make it work. The zip can be attached here. If the extension is not taken into charging you add a .txt extension and it will work. Quote Link to comment Share on other sites More sharing options...
ZenZoy Posted January 30, 2016 Share Posted January 30, 2016 Thanks Dad72, i figured it out!! it was an ASP.Net 5.2 setup issue ... in the startup.cs file I had to include the following so it would recognize babylon files app.UseStaticFiles(new StaticFileOptions { ServeUnknownFileTypes = true, DefaultContentType = "application/javascript" }); //app.UseDirectoryBrowser(); // Set up custom content types - associating file extension to MIME type var provider = new FileExtensionContentTypeProvider(); provider.Mappings.Add(".babylon", "application/javascript"); Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 30, 2016 Share Posted January 30, 2016 ok Quote Link to comment Share on other sites More sharing options...
babaorhum Posted March 23, 2017 Share Posted March 23, 2017 On 27/05/2014 at 5:52 PM, davrous said: Try to add that to your web.config file: <system.webServer> <staticContent> <mimeMap fileExtension=".fx" mimeType="application/fx" /> <mimeMap fileExtension=".babylon" mimeType="application/babylon" /> <mimeMap fileExtension=".babylonmeshdata" mimeType="application/babylonmeshdata" /> </staticContent></system.webServer> Thanks, God 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.