Jan23 Posted August 12, 2017 Share Posted August 12, 2017 Hi there, using Angular I have problems loading gltf-files. Now, I think I've narrowed as loading a Babylon file (*.babylon) works fine. Also, loading a gltf file in a simple non-webpack project works fine as well. The issue is (probably) that the gltf-loader is not loaded by webpack. I've found this issue (https://github.com/BabylonJS/Babylon.js/issues/2265) but I still can't get it working. So, how do I integrate the loaders using webpack? Thanks and cheers, Jan Quote Link to comment Share on other sites More sharing options...
Jan23 Posted August 12, 2017 Author Share Posted August 12, 2017 OK, as a workaround I'm using the bundled files, which I've copied in the assets directory in a newly created js directory: <script src="assets/js/babylon.max.js"></script> <script src="assets/js/babylon.glTFFileLoader.min.js"></script> Then to use it in Angular (Typescript) I've just copied (appended) the whole content of the babylon.d.ts into the typings.d.ts file which is located at the project root directory and is created by the Angular CLI. If you're not using Angular or Angular with the CLI you can place your custom typings whereever you wish but need to specify the location in the tsconfig.json. Loading works! Now, I only need to figure out, how to set the camera to acutally see my models :-) ... but that's the fun part, I hope :-) GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 14, 2017 Share Posted August 14, 2017 Thanks for sharing your findings 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.