@sayduck/three-gltf-loader
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • Public • Published

Sayduck's customized version of three.js glTF loader

Installation

npm i --save @sayduck/three-gltf-loader

Description

three.js's 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 official GLTFLoader docs.

Package Sidebar

Install

npm i @sayduck/three-gltf-loader

Weekly Downloads

1

Version

2.1.1

License

MIT

Unpacked Size

12 MB

Total Files

50

Last publish

Collaborators

  • sam_sayduck
  • coleman-rose
  • qtruongngoc95
  • joelsayduck
  • danielgato
  • felixsayduck