How to apply transformation matrix?

I’m using Panda3D to emulate a stereo camera.

I’m trying to replicate the extrinsics for the positioning of the two imagers. I would like to be able to apply a 4x4 transformation matrix (obtained from calibration, which includes the translation and rotation) to a nodepath. How can I go about this?

I’ve always used setPos and setHpr for translations and rotations, but I obviously don’t want to decomposed the transformation matrix in order to use those methods.

thanks in advance

I think that you would use the “setMat” method of NodePath.

You can create a Mat4 matrix by passing its elements directly into its constructor.

Keep in mind that matrices in Panda3D are row-major, so be careful in what order you pass them.