clearNodeTransform

  • Clears local transform of the Node, applying the transform to children and meshes.

    • Applies transform to children
    • Applies transform to mesh
    • Resets lights, cameras, and other attachments to the origin

    Example:

    import { clearNodeTransform } from '@gltf-transform/functions';
    
    node.getTranslation(); // → [ 5, 0, 0 ]
    node.getMesh(); // → vertex data centered at origin
    
    clearNodeTransform(node);
    
    node.getTranslation(); // → [ 0, 0, 0 ]
    node.getMesh(); // → vertex data centered at [ 5, 0, 0 ]
    

    To clear all transforms of a Node, first clear its inherited transforms with clearNodeParent, then clear the local transform with clearNodeTransform.

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.