kovacsv / assimpjs

The emscripten interface for the assimp library that allows you to import 40+ 3D file formats in the browser.
MIT License
117 stars 18 forks source link

Question: Have you tried to couple this with Threee.js #15

Open kimkulling opened 5 months ago

kimkulling commented 5 months ago

Hi, I am the maintainer of the Asset-Importer-Lib Repo. Thanks for all your great work here. I am impressed that you have addressed the wasm issue already. I am currently thinking about integrating a js-based renderer to our model repo. Rendering the stuff would be easy by using trree.js. But I need to intregrate omehow the aiScene intermedfiate format to three.js.

So here somes my question: Have you alreasy some experiences with this approach?

Thanks in advance! Kim Kulling

kovacsv commented 5 months ago

Hi @kimkulling, it's nice to see you here, and thank you for the wonderful assimp library.

Earlier I've made an experiment to build a three.js based viewer. It exists on a branch, but never made it to main because of the limited time I had for this experiment. You can find the code here: https://github.com/kovacsv/assimpjs/tree/viewer/docs

My approach was to convert to glb with assimp and visualize it with three.js. For that a trick is needed to load a binary buffer as glb: https://github.com/kovacsv/assimpjs/blob/viewer/docs/source/viewer.js#L56.

Probably it would be a better approach to use the assimp json format directly because some data is lost during GLB conversion, too.