Load a glTF or GLB model, the .bin and images of a .gltf from beside it
- A texture only OPAQUE materials use loads with its alpha set to 1, so the 3D pass cuts no holes in it
urlstring
LittleJS glTF Plugin
Load a glTF or GLB model, the .bin and images of a .gltf from beside it
url stringParse a model from GLB bytes or glTF JSON, fetching the buffers and images it refers to
data ArrayBuffer|ArrayBufferView|Object<string, any>|stringGLB bytes, or the glTF JSON as bytes, text or an object
baseUrl string optionalWhere the .bin and image files are, with its trailing slash; loadGLTF passes the file's folder
files Map<string, Blob> optionalThe files it refers to, by their paths, in place of fetching them
// the files of a drop, a .gltf with its .bin and textures, by their names
const files = new Map([...dataTransfer.files].map((file)=> [file.name, file]));
const gltf = [...files.values()].find((file)=> file.name.endsWith('.gltf'));
const model = await parseGLTF(await gltf.text(), '', files);GLTFSkin : Objectgltf.js:89What bends a skinned part: its joints, the nodes that move it, their inverse bind matrices, and for each vertex of its mesh four joints and four weights, with the place and normal each pose bends from
joints Array<number>The joints, as node numbers
inverseBind Array<Matrix4>Each joint's inverse bind matrix
vertexJoints Uint16ArrayFour joints a vertex, as places in joints
vertexWeights Float32ArrayFour weights a vertex, summing to 1
bindPoints Float32ArrayEach vertex's place as stored, x y z
bindNormals Float32ArrayEach vertex's normal as stored, x y z