Repository navigation
glTF 2.0 and GLB formats support added.
Each model accepts exactly one source: objUrl, objText, gltfUrl, gltfText, glbUrl, or glbData. All formats also accept optional translation, rotation, and scale values. Scene and asset URLs remain owned and hosted by the consuming application.
Hosted glTF and GLB files resolve external buffers and images relative to their model URL. For a local .gltf upload, map each selected sidecar filename to its blob URL:
const scene = {
models: [{
id: 'local-product',
gltfText,
resourceUrls: {
'product.bin': binaryBlobUrl,
'albedo.png': albedoBlobUrl,
},
}],
};Local GLB files can be passed directly as glbData: await file.arrayBuffer().
The glTF 2.0 loader supports .gltf JSON and binary .glb assets, embedded or external buffers and images, indexed and non-indexed triangle primitives, node hierarchies and TRS/matrix transforms, POSITION, TEXCOORD_0, and PBR base-color textures. Sparse accessors, non-triangle primitive modes, animation, skinning, morph targets, and compressed mesh extensions such as Draco or Meshopt are rejected with an explicit error.