Jump to content

.obj Importer File vs File Location Question.


Pryme8
 Share

Recommended Posts

When you go to import a model and you call the import constructor, Ive noticed you have to have the location of the file, is it possible to just reference the memory instance of a file? IE I upload a .obj to a input DOM element it holds the actual file not the location.  Ive tried to do a URI convert but to no avail, i feel like that would be the simplest process.  But I was mainly wondering is it possible to call an import constructor with the file and not the location.

Link to comment
Share on other sites

I think you talking about browser restrictions to load a file directly from disk. The Problem here is, that at somepoint to user has to insight, agains loading any file, the programmer just put in his code.
I can vistit a website, and you start deleting my window folder etc. A Filereader is necessary here.

babylonjs
BABYLON.Tools.LoadFile

javascript
var reader = new FileReader();

Link to comment
Share on other sites

Ive tried that, and it does not work, I have tried passing it as binary, as text blah blah blah... its been annoying...  I understand the whole premise of loading from the DOM, and have done COR loaders in BJS that are able to import a model as raw text and turn it into a URI component that is then referable to the object loader.

Im about to say screw it and just make my own fbx importer, Im starting to think the obj importer breaks normals anyways.

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...