I have a use case in which I am trying to load a GLTF file which is compressed using DRACO-Compression. I am able to run it using plain javascript but I am facing issues integrating the loader with ReactJs.
What I am doing:
- Copying the draco library from here into my application’s scope - https://github.com/mrdoob/three.js/tree/master/examples/js/libs/draco
- Copying the DRACOLoader.js from here into my application’s scope - https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/DRACOLoader.js
- Exporting it as a THREE.DRACOLoader Module in my application where I need it
The error I am getting - DracoDecoderModule is not defined
In my app, this is how I am importing:
import DRACOLoader from './DRACOLoader'
DRACOLoader.setDecoderPath('./draco/')
DRACOLoader.js file I am using - DRACOLoader.js (19.3 KB)