HoloLite Posted October 27, 2017 Share Posted October 27, 2017 Hello, I was trying the http://playground.babylonjs.com/#E0WY4U#, demo and clicked the 'zip' button to save the source files. I then tried to hit the saved pages using local webserver, but I was getting exception (see the attached file). The generated index.html (also attached here) has the following external references: <title>Babylon.js sample code</title> <!-- Babylon.js --> <script src="https://www.babylonjs.com/hand.minified-1.2.js"></script> <script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script> <script src="https://preview.babylonjs.com/cannon.js"></script> <script src="https://preview.babylonjs.com/oimo.js"></script> <script src="https://preview.babylonjs.com/babylon.js"></script> Looks like some GUI type is not defined, I guess the included gui.js is not correct ? Please help. Thanks. index.html Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted October 27, 2017 Share Posted October 27, 2017 Hi @HoloLite Babylon GUI is an extention and must be included After the babylon.js file. this is a bug in the sample download, a fix is on the way but for now just move babylon.js line above babylon.gui.js like shown below <script src="https://www.babylonjs.com/hand.minified-1.2.js"></script> + <script src="https://preview.babylonjs.com/babylon.js"></script> <script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script> <script src="https://preview.babylonjs.com/cannon.js"></script> <script src="https://preview.babylonjs.com/oimo.js"></script> - <script src="https://preview.babylonjs.com/babylon.js"></script> Quote Link to comment Share on other sites More sharing options...
HoloLite Posted October 27, 2017 Author Share Posted October 27, 2017 @aWeirdo Ah yes I just noticed that too. Thanks for the tip! Now it's working... however the controllers are not showing. Looking at the errors, it looks like it can't download the controller assets ? Any ideas ? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted October 27, 2017 Share Posted October 27, 2017 404 means that the meshes aren't being loaded, but they are at that URL. My guess is that it is CORS related or file:// policy. You can get those meshes from github and put on your server:https://github.com/BabylonJS/Babylon.js/tree/master/assets/meshes/controllers/microsoft/045E-065B edit: WindowsMotionController.MODEL_BASE_URL So, at least when loading file://, I think you could do: BABYLON.WindowsMotionController.MODEL_BASE_URL = '/myfolder/' Quote Link to comment Share on other sites More sharing options...
HoloLite Posted October 28, 2017 Author Share Posted October 28, 2017 @brianzinn thanks for the feedback. I did try your suggestion. I copied the assets dir (including the meshes dir) onto my local web server. In my local web server's root directory, the file 'assets\meshes\controllers\microsoft\045E-065B\right.glb' or left glb actually exists. Then I set: BABYLON.WindowsMotionController.MODEL_BASE_URL = "/assets/meshes/controllers/microsoft/"; But I am still getting the 404 error, even though the actual path to the .glb file actually exists. Any idea what went wrong ? Quote Link to comment Share on other sites More sharing options...
davrous Posted October 28, 2017 Share Posted October 28, 2017 Hello! This is because the Windows MR controllers are using glTF. It's also an extension you have to reference. I thought we had a warning message but apparently we didn't cc @Deltakosh In conclusion, to make my sample works on your machine you need : - to download or reference our GUI extension library as it's not in the core of Babylon.js - to download or reference our glTF loader extension Thanks! David Quote Link to comment Share on other sites More sharing options...
HoloLite Posted October 28, 2017 Author Share Posted October 28, 2017 @davrous Yes it worked now. This is awesome! Thank you for the help! brianzinn 1 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.