lateKnight Posted May 13, 2016 Share Posted May 13, 2016 Hello dear Forum, i have a Question regarding dynamic Asset Loading in Babylon.js. I was not able to find Information about this topic in the Documentation or the Forum (don´t slay me if I missed something ). So basically what I want to be able to achieve is: 1. User clicks a HTML-Button (for Example "Load Model") // Button should be outside of the Canvas if possible 2. Button calls Function with modelName as Parameter 3. Function checks if Model with modelName exists in some Kind of Library 4. If so, the Model gets Downloaded 5. Model gets rendered So, as far as i was able to find out, it is totally possible to pass Information from a HTML-Element to the Babylon Engine. But is it possible to download something at runtime (CORS is considered) that has never before been used inside the Project. The reason for this is that I want the Game to handle almost the whole "What shall i display?, Where shall i display it?, Which Components does the Object have" - Functionality dynamically without defining too much of it inside the Project. I hope I was able to give you an insight into what I want to achieve. Regards, Markus Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 14, 2016 Share Posted May 14, 2016 hi you dont need do more if you know load scene in babylon js just detect your time and Use same code there lateKnight 1 Quote Link to comment Share on other sites More sharing options...
gryff Posted May 14, 2016 Share Posted May 14, 2016 Hi lateKnight. Welcome to the forum . I'm not the best coder on this forum by any stretch of the imagination - but I will make a suggestion. BABYLON.SceneLoader.Append(....) Create a basic empty/basic BJS scene then have your HTML buttons call a function that uses the above type of code to append your new model to that scene See here for an example of using that type of function by @JCPalmer cheers, gryff lateKnight 1 Quote Link to comment Share on other sites More sharing options...
lateKnight Posted May 17, 2016 Author Share Posted May 17, 2016 Ok, so i can just use the Asset-URL as an Argument for: BABYLON.SceneLoader.ImportMesh() Thats pretty neat. 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.