Currently, I am working on developing a native iOS and Android application using three.js and Capacitor. One of the challenges I am facing is loading GLTF models from an asset folder that is bundled with the code and delivered to the user. I am unsure about the best approach to tackle this issue.
The documentation for the GLTF Loader's load
function can be found here. It requires a URL to load the model. On the other hand, the Parse function takes a "glTF asset to parse, as an ArrayBuffer". How can I effectively load this glTF file into memory while adhering to best practices? I attempted to use
import * as Model from './models/myModel.gltf'
, but encountered a Cannot find module
error.