Bladetrick Posted August 30, 2018 Share Posted August 30, 2018 Apologies if the title is misleading. I wasn't quite sure how to shorten up what i wanted to say. Here goes: So I'm working on two asp.net pages. The first allows a user to upload an OBJ file to the server where it gets inserted into a database. The second page allows the user to select an OBJ file from the database and display it in the browser. I'm having problems visualizing how this is going to work, but I would like it to: Select a model from a combobox containing the list of available models in the database. Store that model in a string[] type variable then send it to the client side where its stored in some web control. A hidden input or other type. Use the AssetsManager to load the string[] (OBJ file) and render it to the browser. Are there any existing code samples that do this? I know babylon can load a JSON object and render it but what about an OBJ file in the form of a string/text value? Or if not, maybe a suggestion for a good OBJ to JSON converter? Or is it as simple as using JSON.stringify()? Thank you, Car Quote Link to comment Share on other sites More sharing options...
Guest Posted August 30, 2018 Share Posted August 30, 2018 Hello! You can call the SceneLoader.Append like this to get data from a serialized source: BABYLON.SceneLoader.Append('', 'data:'+serializedJson, scene, function(newScene) { }, null, null, ".obj"); Bladetrick and babbleon 2 Quote Link to comment Share on other sites More sharing options...
Bladetrick Posted August 30, 2018 Author Share Posted August 30, 2018 hey thanks! i'll give that a whirl in the AM. have a nice night! Quote Link to comment Share on other sites More sharing options...
dbawel Posted August 31, 2018 Share Posted August 31, 2018 @Bladetrick I hope you have good luck with trying to implement the asset manager to do the work. However, the .OBJ, MTL, and texture file all have to be available at the time of import. I'm trying to implement this into a server database myself right now. We'll have something soon, but no code to share. However, I'll do my best to keep you posted on how we accomplished this for multiple real time users. Just message me in a week or two if you aren't able to solve yourself. I don't use Json files, so I can't add to any discussion on Json. DB 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.