Jump to content

Can Not Load a Babylon Scene


Ryu
 Share

Recommended Posts

Hi Everyone,

I am a newbie developer in babylonJs. I am learning it on my own. I am trying to load a babylon scene in an html page, but I don't seem to get it right. Please see "Babylon-no-load-issue.png" for reference.

The scene files works perfect in babylon sandbox. I don't know what I am doing wrong. 

Can someone point out what I am doing wrong and how to correct it?

Please see the attachment for the demo files that I am working with.

Thanks in advance.

Babylon Demo.rar

Link to comment
Share on other sites

Hello and welcome Ryu

a common cause for this issue is the server you use to host your page. You cannot just click on it from your hard drive because browsers have security restrictions for content coming from local host

So first question: are you hosting your page on a webserver? (even local like apache or IIS)

Link to comment
Share on other sites

@NasimiAsl I tested it on firefox taking your advice, it seems to work fine on firefox. Thanks a lot !!! 

I would like to know why it's not working on other browsers and how to correct it. 

@Deltakosh I have the demo files located on my desktop folder. I have wamp installed on my laptop, it has apache 2.4.17. Is it enough? 

Can you give me step by step instructions on how to make the demo work on apache server?

Thanks in advance.

 

 

Link to comment
Share on other sites

@Deltakosh @NasimiAsl I put the babylon demo folder inside www folder of the wamp, and renamed the babylon.html to index.php.

I tried to open the URL "http://localhost/babylon%20demo/" and it works on chrome, firefox and opera. It does not work on IE.

Is this what I was supposed to do in the first place?

Are their any other alternatives?

Thanks in advance.

Link to comment
Share on other sites

The simplest method (assuming you have python installed) is the following (this is for Windows operating system), open up the command line (PowerShell), navigate to the directory with your files and type:

 

#Python 3.x
python -m http.server 8000

#Python 2.x
python -m SimpleHTTPServer 8000

Then navigate to http://localhost:8000 to see your site. This requires only python installed, no Apache/Nginx. It has its limitations but I guarantee you will not run into them for small projects.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...