function fromTransform(mat4, transform) {
  mat4[0] = transform[0];
  mat4[1] = transform[1];
  mat4[4] = transform[2];
  mat4[5] = transform[3];
  mat4[12] = transform[4];
  mat4[13] = transform[5];
  return mat4;
}
@param {Mat4} mat4 Flattened 4x4 matrix receiving the result.
@param {import("../transform.js").Transform} transform Transformation matrix.
@return {Mat4} "2D transformation matrix as flattened 4x4 matrix."