How to get euler angles from a rotation matrix?

Hi @blindinghues, maybe this could help?

const scale = new BABYLON.Vector3();
const rotation = new BABYLON.Quaternion();
const position = new BABYLON.Vector3();

// variable matrix is matrix you're trying to derive yaw, pitch, and roll from
matrix.decompose(scale, rotation, position);

// matrix's rotation should now be stored in the variable rotation

// convert quaternion to Euler angles
rotation.toEulerAngles();
2 Likes