freddythenoob Posted May 27, 2017 Share Posted May 27, 2017 Why is this code not working? I followed this tutorial: https://doc.babylonjs.com/tutorials/creating_a_basic_scene and I used textmate to write it ( I am on a mac ). When I open it it takes me to a blank web page. Quote Link to comment Share on other sites More sharing options...
Nesh108 Posted May 27, 2017 Share Posted May 27, 2017 Hey @freddythenoob, I'd say it's probably because you have called 'babylon.js' as 'babylon.custom.js'. Quote Link to comment Share on other sites More sharing options...
freddythenoob Posted May 27, 2017 Author Share Posted May 27, 2017 Thats not the code I pictured the code in question is basic scene, anyway I renamed it and there was no difference, I am probably being extremely stupid but oh well Quote Link to comment Share on other sites More sharing options...
JohnK Posted May 27, 2017 Share Posted May 27, 2017 If any, what are the error messages in your console ? If you look at the page source what do you get? Quote Link to comment Share on other sites More sharing options...
freddythenoob Posted May 27, 2017 Author Share Posted May 27, 2017 There are no errors in my console, on the web page I can inspect and all the same code it there but it only displays a white screen Quote Link to comment Share on other sites More sharing options...
hit2501 Posted May 28, 2017 Share Posted May 28, 2017 Are you using a web server (like apache-xampp)? Sites with Babylon need a web server to test and check the scene. For Xampp you can: Go to 'control panel' then mark 'Start' for Apache and MySQL Copy your project folder into 'C:/xampp/htdocs' folder Call (index.html) in the browser as: localhost/YOURPROJECTNAME Quote Link to comment Share on other sites More sharing options...
JohnK Posted May 28, 2017 Share Posted May 28, 2017 11 hours ago, hit2501 said: Sites with Babylon need a web server to test and check the scene. Not true. I work with babylon.js locally all the time. Quote Link to comment Share on other sites More sharing options...
gryff Posted May 28, 2017 Share Posted May 28, 2017 @freddythenoob : Hi freddy,, welcome to the forum I'm sure the code experts will help you, but just a thought from a code dummy: Try moving the "babylon.js" (or whatever you call it) script below the "hand.js" and "cannon.js" scripts. in your html file cheers, gryff Quote Link to comment Share on other sites More sharing options...
LoloDev Posted May 28, 2017 Share Posted May 28, 2017 You have to put all your inside window.onload, because your browser is not already when you call document.getElementById("renderCanvas"). Ie: window.onload = function () { var canvas = document.getElementById("renderCanvas"); ... } 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.