mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
Add loader to lib
This commit is contained in:
12
lib/gltfLoader.ts
Normal file
12
lib/gltfLoader.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { THREE } from 'rua-three';
|
||||
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader';
|
||||
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
|
||||
|
||||
const manager = new THREE.LoadingManager();
|
||||
const gltfLoader = new GLTFLoader(manager);
|
||||
const dracoLoader = new DRACOLoader();
|
||||
dracoLoader.setDecoderPath('./libs/draco/');
|
||||
dracoLoader.setDecoderConfig({ type: 'wasm' });
|
||||
gltfLoader.setDRACOLoader(dracoLoader);
|
||||
|
||||
export { manager, gltfLoader, dracoLoader };
|
Reference in New Issue
Block a user