gltf-transform
https://gyazo.com/c41b5fb8357d238907101e55cca62728
使い方
型定義だけ利用する
せっかくモノレポ構成なので、型定義だけ別レポジトリにしてもいいような気はするよね
code:ts
import { GLTF as GLTFSchema } from '@gltf-transform/core';
const json = something.json as GLTFSchema.IGLTF;
ファイルを利用した読み書き
code:ts
import { WebIO } from '@gltf-transform/core';
const io = new WebIO( { credentials: 'include' } );
const doc = await io.read( 'path/to/model.glb' );
const docBinary = await io.readBinary( glbArrayBuffer );
const glb = await io.writeBinary( newDoc );