Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juunini/three-async-gltf-loader
Async GLTF Loader of ThreeJS
https://github.com/juunini/three-async-gltf-loader
async gltf loader threejs
Last synced: 27 days ago
JSON representation
Async GLTF Loader of ThreeJS
- Host: GitHub
- URL: https://github.com/juunini/three-async-gltf-loader
- Owner: juunini
- License: mit
- Created: 2022-12-08T03:48:13.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-24T17:31:56.000Z (about 2 years ago)
- Last Synced: 2024-12-17T21:17:18.291Z (about 2 months ago)
- Topics: async, gltf, loader, threejs
- Language: TypeScript
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ThreeJS Async GLTF Loader
![]()
![]()
---
## Install
```bash
# npm
npm install three-async-gltf-loader# yarn
yarn add three-async-gltf-loader# pnpm
pnpm add three-async-gltf-loader# bun
bun add three-async-gltf-loader
```## Usage
```ts
import { AsyncGLTFLoader } from 'three-async-gltf-loader';// Instantiate a loader
const loader = new AsyncGLTFLoader();// Optional: Provide a DRACOLoader instance to decode compressed mesh data
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath('/examples/jsm/libs/draco/');
loader.setDRACOLoader(dracoLoader);// Load a glTF resource
const gltf = await loader.loadAsync(
// resource URL
'models/gltf/duck/duck.gltf',
// called while loading is progressing. optional
function (xhr: XMLHttpRequest) {
console.log(`${xhr.loaded / xhr.total * 100} % loaded`)
},
);
```