You can also use Python 3 if you have it installed.
Go to the directory with your index.html using a command prompt and type
“python -m http.server”
In your browser go to “localhost:8000”
To refresh the page us ctrl+F5
Put the files you want to load in your project directory or a sub directory and load like this, “./sub directory/file.jpg”
This will still work when you upload to a web server.
Thank you very much guys, I created the web server with IIS, loaded my project as index.html inside wwwroot of inetpub and used the path to localhost/filename.stl Worked like a charm.
Bellow the code:
var Tavola = BABYLON.SceneLoader.ImportMesh("", “”, “http://localhost/SKFFinishedPart.stl”, scene, function (newMeshes){
Tavola = newMeshes[0];
Tavola.position=new BABYLON.Vector3(25,10,0);
Tavola.scaling=new BABYLON.Vector3(0.01,0.01,0.01);
c1mat = new BABYLON.StandardMaterial(“c1mat”, scene);
Tavola.material = c1mat;
c1mat.diffuseColor = new BABYLON.Color3(0.5,0.5,0.5);
});
Instead of absolute path like “http://localhost/SKFFinishedPart.stl”, use a relative one like “SKFFinishedPart.stl” (or “./SKFFinishedPart.stl”) as JFerret suggested, this way you’ll be able to push online without issue later