Code Monkey home page Code Monkey logo

three-gltf-loader's Introduction

three.js glTF loader

three.js version license GitHub issues

Note for three >= v0.103.0

Please note, that starting with three.js r103, GLTFLoader is included in the three package itself and installing three-gltf-loader is no longer necessary.

It can be accessed via

import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';

This package will no longer be maintained.

Installation

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

Description

three.js's r111 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.

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

three-gltf-loader's People

Contributors

johh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.