8
$\begingroup$

I am preparing for a computer 3D graphics test and have a sample question which I am unable to solve.

The question is as follows:

For the following 3D transfromation matrix M, find its inverse. Note that M is a composite matrix built from fundamental geometric affine transformations only. Show the initial transformation sequence of M, invert it, and write down the final inverted matrix of M.

$M =\begin{pmatrix}0&0&1&5\\0&3&0&3\\-1&0&0&2\\0&0&0&1\end{pmatrix} $

I only know basic linear algebra and I don't think it is the purpose to just invert the matrix but to use the information in the question to solve this.

Can anyone help?

Thanks

$\endgroup$
3
  • $\begingroup$ What are the fundamental affine transformations you are referring to? permutation matrices and scaling matrices, maybe? $\endgroup$
    – rschwieb
    Jun 1, 2012 at 13:36
  • 1
    $\begingroup$ translation-, scaling- and rotation-matrices $\endgroup$
    – Steven
    Jun 1, 2012 at 14:22
  • $\begingroup$ The use of these 4x4 matrices in 3D graphics is somewhat specialized from ordinary matrix operations. Please see my explanation for a previous Question about the way it is used. $\endgroup$
    – hardmath
    Jun 1, 2012 at 14:45

4 Answers 4

8
$\begingroup$

Here $4\times4$ matrix $M$ represents an affine transformation in 3D. It does so by conveniently combining a $3\times3$ matrix $P$ and a translation $v$ in a way that allows the affine transformation $Pu + v$ to be computed by a single matrix multiplication:

$$M \begin{pmatrix} u \\ 1 \end{pmatrix} = \begin{pmatrix} Pu + v \\ 1 \end{pmatrix} $$

where $M = \begin{pmatrix} P & v \\ 0 & 1 \end{pmatrix}$.

It follows that "undoing" the affine transformation can be accomplished by multiplying by $M^{-1}$:

$$M^{-1} = \begin{pmatrix} P^{-1} & -P^{-1}v \\ 0 & 1 \end{pmatrix} $$

Given that $M = \begin{pmatrix} 0 & 0 & 1 & 5 \\ 0 & 3 & 0 & 3 \\ -1 & 0 & 0 & 2 \\ 0 & 0 & 0 & 1 \end{pmatrix}$, one computes by any of a variety of ways:

$$M^{-1} = \begin{pmatrix} 0 & 0 & -1 & 2 \\ 0 & ^1/_3 & 0 & -1 \\ 1 & 0 & 0 & -5 \\ 0 & 0 & 0 & 1 \end{pmatrix}$$

$\endgroup$
2
$\begingroup$

I know this is old, but the inverse of a transformation matrix is just the inverse of the matrix. For a transformation matrix $M$ which transforms some vector $\mathbf a$ to position $\mathbf v$, then to get a matrix which transforms some vector $\mathbf v$ to $\mathbf a$ we just multiply by $M^{-1}$

$M\cdot \mathbf a = \mathbf v \\ M^{-1} \cdot M \cdot \mathbf a = M^{-1} \cdot \mathbf v \\ \mathbf a = M^{-1} \cdot \mathbf v$

$\endgroup$
1
$\begingroup$

$$\begin{pmatrix}0&0&1&5\\0&3&0&3\\-1&0&0&2\\0&0&0&1\end{pmatrix}$$ $$=\begin{pmatrix}0&0&1&0\\0&1&0&0\\1&0&0&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}-1&0&0&2\\0&3&0&3\\0&0&1&5\\0&0&0&1\end{pmatrix}$$ $$=\begin{pmatrix}0&0&1&0\\0&1&0&0\\1&0&0&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}-1&0&0&0\\0&3&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}1&0&0&-2\\0&1&0&1\\0&0&1&5\\0&0&0&1\end{pmatrix}$$

$$ =\begin{pmatrix}0&0&1&0\\0&1&0&0\\1&0&0&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}-1&0&0&0\\0&3&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}1&0&0&-2\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}1&0&0&0\\0&1&0&1\\0&0&1&5\\0&0&0&1\end{pmatrix} $$

$$ =\begin{pmatrix}0&0&1&0\\0&1&0&0\\1&0&0&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}-1&0&0&0\\0&3&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}1&0&0&-2\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}1&0&0&0\\0&1&0&1\\0&0&1&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&1&5\\0&0&0&1\end{pmatrix} $$

The inverse of each factor individually is easy, so you can just compute those, then multiply in the reverse order to find the inverse of the matrix. (Remember for matrices $(AB)^{-1}=B^{-1}A^{-1}$, that is what I mean by reverse the factors.) Is this what you call fundamental affine transformations?

The first factor is permutes the rows, the second rescales them, then the last three are operations of the same type which produce a linear combination of of two rows.

$\endgroup$
9
  • $\begingroup$ @Steven Also, be sure to double check my work above. It's hard to get everything right when there is so much TeX, and my comp was displaying it extremely slowly so I might have some corrections to make. $\endgroup$
    – rschwieb
    Jun 1, 2012 at 13:56
  • $\begingroup$ Thanks for your super fast answer. Can you explain to me how you you computed the transformation sequence of M? I don't quite get that. And are you sure that there isn't an easier way? Don't get me wrong, I don't want to insult you or anything like that but the task is from a former test and the time one has for this question is 4 minutes. That's why I think there might be a faster way. $\endgroup$
    – Steven
    Jun 1, 2012 at 14:08
  • $\begingroup$ @Steven At each step I just mentally factored it by asking myself "what row operation do I need?". With a little practice it goes faster. You would also have to have good practice with inverting those things. There could be a faster way, but I haven't been sitting in your class so I'm not very sure what your teacher has in mind. $\endgroup$
    – rschwieb
    Jun 1, 2012 at 14:27
  • $\begingroup$ @Steven No, that's OK I totally understand about wanting a quicker method :) I'll do my best! $\endgroup$
    – rschwieb
    Jun 1, 2012 at 14:36
  • $\begingroup$ Note that the 4x4 matrix is said to be " a composite matrix built from fundamental geometric affine transformations". So you need to separate the 3x3 matrix multiplication from the affine translation part. $\endgroup$
    – hardmath
    Jun 1, 2012 at 14:48
0
$\begingroup$

I'll take a stab at a second method too, to see if that's what your teacher had in mind.

The idea is to use this post and/or this post, because:

$$M=\begin{pmatrix}0&0&1&0\\0&1&0&0\\1&0&0&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}-1&0&0&2\\0&3&0&3\\0&0&1&5\\0&0&0&1\end{pmatrix}$$

$$=\begin{pmatrix}0&0&1&0\\0&1&0&0\\1&0&0&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}-1&0&0&0\\0&3&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}1&0&0&-2\\0&1&0&1\\0&0&1&5\\0&0&0&1\end{pmatrix}$$

$$=\begin{pmatrix}0&0&1&0\\0&1&0&0\\1&0&0&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}-1&0&0&0\\0&3&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}\left[\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}+\begin{pmatrix}0&0&0&-2\\0&0&0&1\\0&0&0&5\\0&0&0&0\end{pmatrix}\right]$$

You can see that the brackets have a unit plus a nilpotent $B$ ($B^2=0$). I think the link above might be able to help you invert that right half quickly.

Yes, of course here $(I+B)^{-1}=I-B$. So we know: $$M^{-1}=\begin{pmatrix}1&0&0&2\\0&1&0&-1\\0&0&1&-5\\0&0&0&1\end{pmatrix}\begin{pmatrix}-1&0&0&0\\0&1/3&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}\begin{pmatrix}0&0&1&0\\0&1&0&0\\1&0&0&0\\0&0&0&1\end{pmatrix}$$ which isn't so hard to compute. Multiply the left pair first, then with the final matrix on the right to get this in only a minute:

\begin{pmatrix}0&0&-1&2\\0&1/3&0&-1\\1&0&0&-5\\0&0&0&1\end{pmatrix}

$\endgroup$
2
  • $\begingroup$ The $\frac{-1}{3}$ is a sign error, as you will see by checking the product with $M$. Otherwise my answer agrees with yours. $\endgroup$
    – hardmath
    Jun 3, 2012 at 14:38
  • $\begingroup$ @hardmath Yup, looks like that crept in... will correct it now. That day the TeX was rendering realllly slowly and every time I changed something it took 15-20 seconds to come up. So I lost patience... $\endgroup$
    – rschwieb
    Jun 3, 2012 at 14:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .