Skip to content

Drag&Drop or file input element support in Browsers #526

Answered by donmccurdy
rebior asked this question in Q&A
Discussion options

You must be logged in to vote

The general approach would be to assemble a JSONDocument object containing:

  • .json property (.gltf JSON content)
  • .resources property (mapping URLs/paths to binary Uint8Array objects)

Or if you have a .glb you can, invoke io.readBinary(glb) on the Uint8Array directly.

Those methods could be used to support drag-and-drop (I've implemented an example here), or to support any other source the I/O classes don't handle out of the box like websockets, complex authentication, database connections, etc.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by donmccurdy
Comment options

You must be logged in to vote
1 reply
@donmccurdy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants