troisjs / trois

✨ ThreeJS + VueJS 3 + ViteJS ⚡
https://troisjs.github.io
MIT License
4.19k stars 299 forks source link

DRACOLOADER.js how to extend the troidjs Loader #187

Open bluelemonade opened 1 year ago

bluelemonade commented 1 year ago

I have a GltfModel Tag

<GltfModel src="./export-bibel-3/Bibel30kPBR_2048.glb" @load="onReady" @beforeLoad="initDraco()" @progress="onProgress" @error="onError" :rotation="{ x: 0, z: 0 }"/>

inside the tag I load the draco js.

    const initDraco = () => {  // loader
      const dracoLoader = new DRACOLoader(); 
      console.log(dracoLoader)
      console.log(GltfLoader);
      dracoLoader.setDecoderPath('/examples/js/libs/draco');
     ???????
    }

but how can put the dracoLoader to the loader like in three.js loader.setDRACOLoader( dracoLoader );

kartsims commented 1 year ago

PR #185 is addressing this specific issue

I don't think it's possible for now, an alt solution would be to bypass troisjs's component and call the GLTF loader separately