Jump to content

Render an OBJ string with Babylon JS?


Bladetrick
 Share

Recommended Posts

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:

  1.  Select a model from a combobox containing the list of available models in the database.
  2.  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.
  3.  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

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...