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

0.1.0 • Public • Published

@muds/gltf

NPM @muds/gltf License: MIT

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.

Package Sidebar

Install

npm i @muds/gltf

Weekly Downloads

6

Version

0.1.0

License

MIT

Unpacked Size

120 kB

Total Files

40

Last publish

Collaborators

  • andykswong