Model loading · function
gltfToMeshes
Turn a document into meshes in world space, one per primitive.
Explained in Importing models.
function gltfToMeshes(doc: GltfDocument, buffers: readonly Uint8Array[], options?: GltfReadOptions):import { gltfToMeshes } from '@driftengine/assets';Parameters
| Parameter | Type | Description |
|---|---|---|
doc | GltfDocument | |
buffers | readonly Uint8Array[] | |
options? | GltfReadOptions |
In depth
One MeshData per primitive rather than per glTF mesh, because a primitive is the unit
that carries a single material — and a MeshData has one material's worth of vertex
attributes. Merging them would mean losing the distinction the file was drawing.