Applies a transform matrix to every Primitive in the given Mesh.
Method:
If any primitives are shared by other meshes, they will be detached.
If any vertex streams are shared by primitives of other meshes, vertex data
will be overwritten unless overwrite=false or the indices are masked. If
overwrite=false, a detached copy of the vertex stream is made before applying
the transform.
Primitives within the mesh sharing vertex streams will continue to share those streams.
For indexed primitives, only indexed vertices are modified.
Applies a transform matrix to every Primitive in the given Mesh.
Method:
Example:
import { fromTranslation } from 'gl-matrix/mat4'; import { transformMesh } from '@gltf-transform/functions'; // offset vertices, y += 10. transformMesh(mesh, fromTranslation([], [0, 10, 0]));