/* 解壓縮 lib 載入器
* https://threejs.org/docs/#examples/en/loaders/DRACOLoader
* https://google.github.io/draco/
*/
const dracoLoader = new THREE.DRACOLoader();
/* 指定解壓器的位置 */
dracoLoader.setDecoderPath('../Scripts/three.145/libs/draco/');
/* GLTF 載入器 */
const gltfLoader = new THREE.GLTFLoader();
gltfLoader.setDRACOLoader(dracoLoader);
/* 載入模型 */
gltfLoader.load('Model.glb', function (gltf) {
const model = gltf.scene;
scene.add(model);
});
2023-03-07 11:37
[ThreeJS] 載入壓縮過 GLTF 檔
分類:
JavaScript,
ThreeJS,
Web 3D
相關文章 :
訂閱:
張貼留言 (Atom)
0 回應:
張貼留言