Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

three-gltf-loader

1.102.0 • Public • Published

three.js glTF loader

three.js version license GitHub issues

Installation

yarn add three-gltf-loader
npm i --save three-gltf-loader

Description

three.js's r102 GLTFLoader wrapped as a module for easy importing, TypeScript type definitions included.

Usage

import * as THREE from 'three';
import GLTFLoader from 'three-gltf-loader';
 
const loader = new GLTFLoader();
loader.load(
    'path/to/your/file.gltf',
    ( gltf ) => {
        // called when the resource is loaded
        scene.add( gltf.scene );
    },
    ( xhr ) => {
        // called while loading is progressing
        console.log( `${( xhr.loaded / xhr.total * 100 )}% loaded` );
    },
    ( error ) => {
        // called when loading has errors
        console.error( 'An error happened', error );
    },
);

For further documentation, see the GLTFLoader docs.

Reporting Issues

Please note that this is just a wrapper for the glTF loader provided by three.js. Therefore, any issues regarding the loader should be reported directly via the three.js issue tracker. TypeScript definitions are provided by the official three package on DefinitelyTyped.

For issues directly related to the wrapper or this package specifically, feel free to contact me.

install

npm i three-gltf-loader

Downloadsweekly downloads

2,195

version

1.102.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability