KerwinK Posted September 12, 2018 Share Posted September 12, 2018 Can anyone please tell me if it is possible to load a *.glb file off a local drive with Babylon.viewer.js? Note: I have a valid glb file I named part2.glb... and it works fine to display locally in the Mixed Reality viewer in Windows 10... and also up in Remix 3D community models page. However, when I try to open it off a local drive with the simple 2 line HTML syntax (see below) I receive an error in the browser page display "Error loading the model". <head> <title>Babylon.js Viewer - Display a 3D model</title> <!-- <script src="https://preview.babylonjs.com/viewer/babylon.viewer.js"></script> --> <script src="C:\Babylon.js\Babylon.js-master\dist\viewer\babylon.viewer.js"></script> </head> <body> <!-- <babylon model="https://models.babylonjs.com/boombox.glb" templates.main.params.fill-screen="true"></babylon> --> <babylon model="C:\part2.glb" templates.main.params.fill-screen="true"></babylon> --> </body> Quote Link to comment Share on other sites More sharing options...
devAxeon Posted September 13, 2018 Share Posted September 13, 2018 Hi @KerwinK, First, you should try to install a web server and launch your html file on it. Take a look at wamp, xampp or easyphp. Then you will be able to load your file with relavive path (ex: model="./assets/part2.gbl"). bghgary 1 Quote Link to comment Share on other sites More sharing options...
KerwinK Posted September 17, 2018 Author Share Posted September 17, 2018 @devAxeon thank you for the suggestion... however, I still get the same error with the file placed on a web server with a relative path. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 17, 2018 Share Posted September 17, 2018 Can you check the console and the f12 network profiler to get more info about the error? Quote Link to comment Share on other sites More sharing options...
KerwinK Posted September 17, 2018 Author Share Posted September 17, 2018 @deltakosh thank you for the suggestion... here is the error it is displaying: BJS - [16:28:19]: Load Error: There was an error loading the model. Unable to import meshes from //part2.glb: Failed to load scene. Note: As I mentioned in my original post... the model works fine to display locally in the Mixed Reality viewer in Windows 10 and also up in Remix 3D community models page. Quote Link to comment Share on other sites More sharing options...
KerwinK Posted September 18, 2018 Author Share Posted September 18, 2018 I solved the issue of being able to open a *.glb file on a local drive. Placing Babylon.viewer.js and part.glb within the same folder and referencing directly as shown below in the snippet (i.e. with no folder path specification) it works. <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Babylon.js Viewer - Display a 3D model</title> <!-- <script src="https://preview.babylonjs.com/viewer/babylon.viewer.js"></script> --> <script src="babylon.viewer.js"></script> </head> <body> <!-- <babylon model="https://models.babylonjs.com/boombox.glb" templates.main.params.fill-screen="true"></babylon> --> <babylon model="part2.glb" templates.main.params.fill-screen="true"></babylon> </body> </html> trevordev 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted September 18, 2018 Share Posted September 18, 2018 Wonderful! Quote Link to comment Share on other sites More sharing options...
Vorpal Posted February 11, 2020 Share Posted February 11, 2020 On 9/18/2018 at 5:50 AM, KerwinK said: I solved the issue of being able to open a *.glb file on a local drive. Placing Babylon.viewer.js and part.glb within the same folder and referencing directly as shown below in the snippet (i.e. with no folder path specification) it works. I tried the same but it did not work? COuld you send me your files in a zip ? Thx a lot. Very important to me. I can grant you some little money for that. 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.