transformPrimitive

  • transformPrimitive(prim: Primitive, matrix: mat4, skipIndices?: Set<number>): void
  • Applies a transform matrix to a Primitive.

    When calling transformPrimitive, any un-masked vertices are overwritten directly in the underlying vertex streams. If streams should be detached instead, see transformMesh.

    Example:

    import { fromTranslation } from 'gl-matrix/mat4';
    import { transformPrimitive } from '@gltf-transform/functions';
    
    // offset vertices, y += 10.
    transformPrimitive(prim, 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.