Given a single affine transformation in 3D (i.e., TRS transforms) that is represented by a translation vector (t), quaternion (r) and scaling vector (s).
Is there some way of efficiently computing the inverse transform, while maintaining the same representation?
I initially thought that this was a simple as inverting each component, but a simple test with the resulting 4x4 matrices for these transforms clearly shows that this is incorrect. E.g., the transform:
A := ({t=(10, 1, 0), r=(0.97, 0.26, 0, 0), s=(5, 5, 5)}
B := inv(A) // {t=(-10, -1, 0), r=(0.97, -0.26, 0, 0), s=(0.2, 0.2, 0.2)}
ma := A.to_mat4() // { { 5 0 0 10 } { 0 4.3 -2.5 1 } { 0 2.5 4.3 0 } { 0 0 0 1 } }
mb := B.to_mat4() // { { 0.2 0 0 -10 } { 0 0.17 0.1 -1 } { 0 -0.1 0.17 -0 } { 0 0 0 1 } }
i := ma * mb // { { 1 0 0 -40 } { 0 1 0 -3.33013 } { 0 0 1 -2.5 } { 0 0 0 1 } }
// Clearly not the identity matrix
Is this actually possible to do in some way? If not, are there some circumstances under which this can be done?
inv(A*B) = inv(B)*inv(A)\$\endgroup\$