Draco supporting
Aziz87 opened this issue · comments
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); } }
is recept
hi,
I tried to import the dracoloader.js, but where can I find it?
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