I'm starting to work with trimesh objects and i haven't been able to find good info on how to apply transformations to mesh objects (specifically,rotations).
I have a simple planar mesh object:
plane = trimesh.creation.box(extents=[20, 20, 0.01])
How can i rotate it -for example- over an axis?
Take a look at this module and especially at this function.
The
rotation_matrix
requires the direction, angle and center of rotation (optional) as arguments to return the rotation matrix. Then, you can rotate your mesh by using theapply_transform
method which requires therotation_matrix
as argument.Here is the code: