aaronmck Posted August 2, 2016 Share Posted August 2, 2016 Hi, I've created a simple 3d model in 3ds Max and everything exports fine and I am able to view it in sandbox with no problems. When I try to load the scene in the index.html file, all I get is a blank screen when I run it. Here is the code I'm using, if anyone could help please <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"/> <title>PC Deconstructor</title> <script src="babylon.2.4.js"></script> <style> html, body { overflow: hidden; width : 100%; height : 100%; margin : 0; padding : 0; } #renderCanvas { width : 100%; height : 100%; touch-action: none; } </style> </head> <body> <canvas id="renderCanvas"></canvas> <script> var canvas = document.getElementById("renderCanvas"); var engine = new Babylon.Engine(canvas, true); BABYLON.SceneLoader.Load("psu/", "psu.babylon", engine, function (scene) { scene.activeCamera.attachControl(canvas); engine.runRenderLoop(function () { scene.render(); }); }); //Resize window.addEventListener("resize", function () { engine.resize(); }}; </script> </body> </html> Thanks! Quote Link to comment Share on other sites More sharing options...
RaananW Posted August 2, 2016 Share Posted August 2, 2016 So many things can go wrong here! Orin any other code You could have forgotten to have babylon.2.4.js in the right directory. The .babylon file could be somewhere else, or your server could reject the .babylon file because it doesn't know the mime type. There could also be an error in the Javascript itself. But we will never really know without you showing us a live example. Or the console error log What errors are you getting? what server are you using? can you share an online version of this file, server on some public server? We'd love to help, but we are missing a lot of information. Quote Link to comment Share on other sites More sharing options...
aaronmck Posted August 2, 2016 Author Share Posted August 2, 2016 Thanks for the reply. I definitely have babylon.2.4.js in the right directory. I was being an idiot and not using the server. I have WAMP server installed and moved the folder containing my scenes and .html file etc... into the "www" folder of wamp. How do I add the mime type in Apache so it accepts it? Sorry for being such a noob at this! Quote Link to comment Share on other sites More sharing options...
jellix Posted August 2, 2016 Share Posted August 2, 2016 Hi, nice to see that you found the solution. What I've seen in my case was that by opening the html-file without using a webserver, the firefox loads an external file well, while the chrome doesn't load it due to sandbox restrictions. The interesting thing in that case was that there was no error message within the browser debug console. Quote Link to comment Share on other sites More sharing options...
aaronmck Posted August 2, 2016 Author Share Posted August 2, 2016 I haven't really found a solution just yet, I've added it to wamp server but it still does not display when it's run. Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted August 2, 2016 Share Posted August 2, 2016 Did you hit F12 and check to see if there are any errors? Maybe you are missing something like a texture. Quote Link to comment Share on other sites More sharing options...
aaronmck Posted August 3, 2016 Author Share Posted August 3, 2016 There's an error when I press F12 it says "Failed to load resource: net :: ERR_NAME_NOT_RESOLVED" Any ideas as to what that means? Thanks Quote Link to comment Share on other sites More sharing options...
adam Posted August 3, 2016 Share Posted August 3, 2016 Check the network tab to see what failed. Quote Link to comment Share on other sites More sharing options...
aaronmck Posted August 3, 2016 Author Share Posted August 3, 2016 I checked the network tab and it displayed the name of the project as the failure. Done a bit of researching and apparently by clicking the project name from the localhost menu it doesn't add the "localhost/" prefix at the start. So I added that and I don't get the error message any more but I'm now getting a blank page. I was able to open it fine in Chrome when using Visual Studio Quote Link to comment Share on other sites More sharing options...
jerome Posted August 3, 2016 Share Posted August 3, 2016 ERR_NAME_RESOLVED is a DNS error, the system that translates "names" (actually FQDN, ask your favorite search engine) into IP addresses. This means either the distant server name is wrong (not complete,... or typo) either it doesn't exist (at least your DNS client can't resolve it) 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.