I’m trying to derive the matrix of a rigid transform to map between two coordinate spaces. I have the origin and the axis directions of the target coordinate space in terms of the known coordinate space; does anyone know how I can solve for the 4×4 rigid transformation matrix given these?
So, in other words, I have two coordinate spaces, A and B, and I know
Point3D originOfBInA;
Vector3D xAxisOfBInA; // Unit vector
Vector3D yAxisOfBInA; // Unit vector
Vector3D yAxisOfBInA; // Unit vector
And I’m trying to find the 4×4 matrix
Matrix4x4 AtoB;
First construct the 4×4 matrix for the change of basis (call it M) by using your unit vectors (Ax, Ay, Az) and the origin (T) as column vectors:
To transform the coordinates of a point p (specified with respect to frame A) to q (with respect to frame B), just multiply by the inverse of M:
q = M-1p