0.1.0 • Published 2 years ago

@muds/gltf v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@muds/gltf

Overview

@muds/gltf is the minimal glTF 2.0 file loader for muds, a modular microframework for interactive data-oriented systems.

API Documentation

http://andykswong.github.io/muds

Usage

npm install --save @muds/gltf

To load a glTF 2.0 model (both .gltf and .glb formats are supported):

import { loadGlTF, glTF2 } from '@muds/gltf';

const uri = 'https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/BoxTextured/glTF-Binary/BoxTextured.glb';
const {
  glTF, // glTF model in JSON
  buffers, // array of Uint8Array for buffers declared in the model
  images // array of Image for images declared in the model
} = loadGlTF(uri);

// For TypeScript, the glTF model typing is available as glTF2.GlTF
// It is auto-generated from the official glTF 2.0 JSON schema
const typedGlTF: glTF2.GlTF = glTF;

License

This repository and the code inside it is licensed under the MIT License. Read LICENSE for more information.