How can I apply a transformation to the position attribute values in a mesh?

I have a mesh that is loaded from an stl file and displayed in a scene.
I have to do calculations using the vertices of this mesh in another coordinate space.
I need to apply a transformation to those vertices.
I cloned the mesh and applied the transformation using Mesh.applyMatrix().
But the values in mesh.geometry.attributes.position values do not change.
How should I apply that matrix in a way that would change those vertex values?

What you’re looking for is modifying not the Mesh, but the Geometry - BufferGeometry.applyMatrix4 and BufferGeometry.translate should help you (keep in mind - these are quite slow methods for normal meshes, and very slow for complex meshes, so be sure not to run them on every frame.)

1 Like

Thanks. I will try that.