Create a new empty glTF builder.
Add a material with base color (RGBA 0–1 range).
Add a mesh with positions, indices, and optional normals.
positions: Flat Float32Array [x0, y0, z0, x1, y1, z1, ...]indices: Flat Uint32Array [i0, i1, i2, ...]normals: Optional flat Float32Array [nx0, ny0, nz0, ...] (may be null)material_index: Material index (0-based), or -1 for no material.Export as binary GLB (Uint8Array).
Export as glTF JSON string (no binary — positions/indices as base64).
glTF 2.0 builder — collect meshes and materials, then export as GLB or JSON.