Skip to content

JamcaaLaa/gltf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

import { getGlbHead, parseChunk } from '@openspacing/gltf'

const fetchData = async (pathToGlb) => {
  const glbBuffer = await fetch(pathToGlb).then((res) => res.arrayBuffer())
  
  const {
    magic, // always 'glTF'
    version, // 1 or 2
    byteLength, // === glbBuffer.byteLength
  } = getGlbHead(glbBuffer)

  const {
    glbJSON, // glTF JSONObject
    glbBinary, // ArrayBuffer
  } = parseChunk(glbBuffer)

  // ...
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published