• transformMesh(mesh: Mesh, matrix: mat4): void
  • Applies a transform matrix to every Primitive in the given Mesh.

    For every Primitive in the Mesh, the operation first applies compactPrimitive to isolate vertex streams, then calls transformPrimitive. Transformed Mesh will no longer share vertex attributes with any other Meshes — attributes are cloned before transformation.


    import { fromTranslation } from 'gl-matrix/mat4';
    import { transformMesh } from '@gltf-transform/functions';
    // offset vertices, y += 10.
    transformMesh(mesh, fromTranslation([], [0, 10, 0]));
Function symbol, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy. Documentation built with greendoc and published under Creative Commons Attribution 3.0.