How to swap multiple axis of a transformation matrix

702 Views Asked by At

I have a transformation matrix

$$\begin{bmatrix}i_{x} & j_{x} & k_{x} & t_{x}\\ i_{y} & j_{y} & k_{y} & t_{y}\\ i_{z} & j_{z} & k_{z} & t_{z}\\ 0 & 0 & 0 & 1 \end{bmatrix}$$

I need / want to create a transformation matrix or a series of transforms that will cleanly swap the axis to generate:

$$\begin{bmatrix}k_{z} & i_{z} & -j_{z} & -t_{z}\\ k_{x} & i_{x} & -j_{x} & -t_{x}\\ k_{y} & i_{y} & -j_{y} & -t_{y}\\ 0 & 0 & 0 & 1 \end{bmatrix}$$

How do i approach this?

If you were to visualize the matrices as a transformation frame, you would see it as a rotation on the X axis of 90 degrees followed by a rotation of the Y axis by -90 degrees. Which if applied, leads to the correct swapping of tx/ty/tz values but obviously not the rotation components.

1

There are 1 best solutions below

3
On BEST ANSWER

Perhaps this is what you're looking for. We have $$ \begin{bmatrix}k_{z} & i_{z} & -j_{z} & -t_{z}\\ k_{x} & i_{x} & -j_{x} & -t_{x}\\ k_{y} & i_{y} & -j_{y} & -t_{y}\\ 0 & 0 & 0 & 1 \end{bmatrix} = \\ \begin{bmatrix} 0&0&-1&0\\ -1&0&0&0\\ 0&-1&0&0\\ 0&0&0&1 \end{bmatrix} \begin{bmatrix}i_{x} & j_{x} & k_{x} & t_{x}\\ i_{y} & j_{y} & k_{y} & t_{y}\\ i_{z} & j_{z} & k_{z} & t_{z}\\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 0&0&-1&0\\ -1&0&0&0\\ 0&1&0&0\\ 0&0&0&1 \end{bmatrix}. $$