Replies: 1 comment
-
Hi @Samsy! Probably what you want is either import { transformMesh, transformPrimitive } from '@gltf-transform/functions';
import { fromScaling } from 'gl-matrix/mat4';
const matrix = fromScaling([], [2, 2, 2]);
// (A) transform mesh
const mesh = document.getRoot().listMeshes();
transformMesh(mesh, matrix);
// (B) transform prim
const prim = mesh.listPrimitives()[0];
transformPrimitive(prim, matrix); The 4x4 matrix is an array of numbers, as defined in https://gltf-transform.donmccurdy.com/functions.html#transformmesh |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello !
I was reading the doc a could not find a way to bake a world matrix into a geometry position buffer and normals directly, something similar as Three.js :
geometry.applyMatrix4( worldMatrix )
Is there something similar using GLTF-transform ?
Beta Was this translation helpful? Give feedback.
All reactions