Type alias Arrays

Arrays: {
    [key: string]: ArrayUnion;
}

Named Arrays

A set of named arrays are passed to various functions like createBufferLayoutsFromArrays and createBuffersAndAttributesFromArrays

Each array can be 1 of 4 things. A native JavaScript array, a TypedArray, a number, a FullArraySpec

If it's a native array then, if the name of the array is indices the data will be converted to a Uint32Array, otherwise a Float32Array. Use a TypedArray or a FullArraySpec to choose a different type. The FullArraySpec type is only used if it's not already a TypedArray

If it's a native array or a TypedArray or if numComponents in a FullArraySpec is not specified it will be guessed. If the name contains 'coord', 'texture' or 'uv' then numComponents will be 2. If the name contains 'color' or 'colour' then numComponents will be 4. Otherwise it's 3.

For attribute formats, guesses are made based on type and number of components. The guess is based on this table where (d) is the default for that type if normalize is not specified

Type .. normalize
Int8Array sint8 snorm8 (d)
Uint8Array uint8 unorm8 (d)
Int16Array sint16 snorm16 (d)
Uint16Array uint16 unorm16 (d)
Int32Array sint32 (d) snorm32
Uint32Array uint32 (d) unorm32
Float32Array float32 (d) float32

Type declaration

Generated using TypeDoc