troisjs / trois

✨ ThreeJS + VueJS 3 + ViteJS ⚡

Home Page:https://troisjs.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Draco supporting

Aziz87 opened this issue · comments

commented

If you need use DracoLoader

<GltfModel src="/models/optimized/VIKING/BODY/VIKING_BODY_1.glb" @beforeLoad="initDraco">

methods:{ initDraco(loader){ const dracoLoader = new DRACOLoader(); dracoLoader.setDecoderPath('https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/js/libs/draco/'); // use a full url path loader.setDRACOLoader(dracoLoader); } }

commented

is recept

hi,

I tried to import the dracoloader.js, but where can I find it?

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

in vue3
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';

const initDraco = () => {  // loader
      const dracoLoader = new DRACOLoader(); 
      dracoLoader.setDecoderPath('https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/js/libs/draco/');
    }

i got:

onError Error: THREE.GLTFLoader: No DRACOLoader instance provided.
at new GLTFDracoMeshCompressionExtension (GLTFLoader.js?34ad:1305:1)
at GLTFLoader.parse (GLTFLoader.js?34ad:357:1)
at Object.eval [as onLoad] (GLTFLoader.js?34ad:194:1)
at eval (three.module.js?5a89:38709:1)

how can i load this file in troiejs