0% found this document useful (0 votes)
33 views9 pages

010 More On Transformations

More on transformations by matrix. Editable Word file.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views9 pages

010 More On Transformations

More on transformations by matrix. Editable Word file.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

10.

More on Transformations

Inverse Transformations

If a matrix causes a particular transformation on a point, then the inverse matrix reverses the
transformation. Therefore, the inverse matrix of the transformation allows us to reverse any
translation, stretching, rotation or skewing.

Example 1. The differential scaling matrix S has inverse S-1,


S=
[ ]
3 0
0 1
−1
has inverse S =
1/3 0
0 1
. [ ]
Applying S to the point , for instance, gives the new point

[ ][ ] [ ]
3 0 ¿2
0 1 ¿4
= ¿6 .
¿4

So applying S-1 to gets back to .

[ 1/30 01 ][ ¿¿ 64 ]=[ ¿¿ 24 ].
Recalling the “house” in chapter 7, S-1 “squashes” the stretched house back into the original.

Homogeneous Matrices

The homogeneous matrix of a transformation adds a dimension in order to make translation a

matrix operation like all the others. So a 3D vector of form becomes .

Then, for example, the translation matrix for a move 8 along x, 6 along y and 4 up z is

[ ]
1 0 0 8
0 1 0 6
.
0 0 1 4
0 0 0 1
This hides the old transformation vector in the top right-hand corner. Similarly, the
homogeneous matrix for rotation by 100 around the z axis is

[ ]
∘ ∘
cos 1 0 0 −sin 1 0 0 0 0
sin 1 0 0∘ cos 1 0 0∘ 0 0.
0 0 1 0
0 0 0 1

Generally, then, homogeneous matrices look like the following.

Inverses of Homogeneous Matrices

The pattern to follow is ;

Where
 The bulk of the matrix is the inverse of the 3 3 translation matrix
 The translation vector has been transformed using this inverse, then all its elements
inverted (multiplied by -1).

Concatenation

Now that all the operations are in the same form- matrix form- we can concatenate different
operations into the same matrix. That is to say, we can find a single matrix that
simultaneously translates, reflects, scales, rotates and/or shears an object. Indeed we can
concatenate any number of matrices, given a single matrix that saves a lot of computer
memory.

Example 2. Suppose we wished to first translate our shoebox as above, then to rotate it
through 100 around the z axis. The concatenated matrix consists of the rotation matrix
multiplied by the translation matrix.

[ ][ ]
∘ ∘
cos 1 0 0 −sin 1 0 0 0 0 1 0 0 8
sin 1 0 0∘ cos 1 0 0∘ 0 0 0 1 0 6
0 0 1 0 0 0 1 4
0 0 0 1 0 0 0 1

[ ]
0 ( 8 cos 1 0 0 −6 sin 1 0 0 )
∘ ∘ ∘ ∘
cos 10 0 −sin 10 0
0 ( 8 sin 10 0 +6 cos 1 0 0 )
∘ ∘ ∘ ∘
¿ sin1 0 0 cos 1 0 0
0 0 1 4
0 0 0 1

Note that the multiplication is in reverse order to the operations; translate then rotate, but
rotation matrix times translation.

L is convenient for demonstration. Operate on L’s vector- remember L is now 4D, - with
the translate then rotate matrix;

[ ][ ]
0 ( 8 cos 1 0 0 −6 sin1 0 0 )
∘ ∘ ∘ ∘
cos 1 0 0 −sin 1 0 0 5
0 ( 8 sin 1 0 0 +6 cos 1 0 0 ) 4
∘ ∘ ∘ ∘
sin 1 0 0 cos 1 0 0
0 0 1 4 0
0 0 0 1 1

[ ]
−12.1055
11.0660
¿ =LTR.
4
1

It’s important to remember that we’re using the term “moved” loosely when we talk about
transforming a point. It’s not like the point L really moves through the intervening space on

the screen, until it stops at . Rather, a new point is found at , as though L


had moved.
Euler Angles

Consider three different rotation matrices,


Rx which rotates angle p around the x axis,
Ry which rotates angle h around the y axis,
Rz which rotates angle r around the z axis.
The angles r, p and h are the Euler angles (named after Leonhard Euler, an 18th century
mathematician). If we concatenate the three matrices
Rx Ry Rz , the result is a matrix which describes the change in orientation of a 3D object in all
three axes.

Example 3. Returning to the shoe box,

rotations through Euler angles of r = 60, h = 72 and p = 30 might be rendered with the

familiar matrices. Taking point A as the example in each case, applying Rz to A = gives

. (All other points are likewise transformed, rotating the shoebox 60 around the z
axis.)

[ ][ ] [ ]
cos 6 0∘ −sin 6 0∘ 0 0 1 −4.6962
sin 6 0∘ cos 6 0∘ 0 0 6 = 3.8660
0 0 1 0 8 8
0 0 0 1 1 1
Then applying Ry to gives (rotating the shoebox 72 around the y axis).

[ ][ ] [ ]
cos 7 2∘ 0 sin 7 2∘ 0 −4.6962 6.1573
0 1 0 0 3.8660
= 3.8660
−sin 7 2∘ 0 cos 7 2∘ 0 8 6.9384
0 0 0 1 1 1

Then applying Rx to gives (rotating the shoebox 30 around the x axis).

[ ][ ] [ ]
1 0 0 0 6.1573 6.1573
0 cos 3 0 −sin 3 0∘

0 3.8660 −0.1211
∘ ∘
=
0 sin 3 0 cos 3 0 0 6.9384 7.9419
0 0 0 1 1 1

But concatenating the three matrices gives a single matrix in which the Euler angles can be
inserted to jump straight from the first orientation (in which A is ) to the last (where A is
). We’ll call this the E matrix, which for the above angles would be

[ ]
cos 6 0 cos 7 2 −cos 7 2sin 6 0 sin 7 2 0
sin 3 0 sin7 2 cos 6 0+cos 3 0 sin 6 0 −sin 3 0 sin 7 2 sin6 0+cos 3 0 cos 6 0 −sin 3 0 cos 7 2 0
−cos 3 0 sin 7 2 cos 6 0+sin 3 0 sin 6 0 cos 3 0 sin 7 2 sin 6 0+sin 3 0 cos 6 0 cos 3 0 cos 7 2 0
0 0 0 1

This would have the general form

[ ]
cos r cos h −cos h sin r sin h 0
sin p sin hcos r +cos p sin r −sin p sin h sin r + cos p cos r −sin p cos h 0
−cos p sin h cos r +sin p sin r cos p sin h sin r +sin p cos r cos p cos h 0
0 0 0 1 []

in which it’s only necessary to decide what values of r, p and h you require.

Example 4. Consider a die, seen from faces 1, 2 and 3. What faces would show after
successive Euler angles of r = h = p = 90?

If we define this as a cube with vertices A to H as follows,

[ ] [] [ ] [ ] [ ] [ ] [ ] [ ]
1 1 −1 −1 1 1 −1 −1
−1 1 1 −1 −1 1 1 −1
A= , B= , C= , D= , E= , F= , G= , H= .
1 1 1 1 −1 −1 −1 −1
1 1 1 1 1 1 1 1

then the cube lies with its centre at the origin, and successive rotations won’t displace the
cube.
In order to turn the die first 90 around the z axis, then 90 around the x axis, and finally 90
around the y axis, the familiar three could be applied in turn to each point. In a program, we
might choose to do this to simulate the die rolling.

So faces 1, 3 and 5 show. But we could more easily place the angles r = h = p = 90 into the
single E matrix as above. Because sin90 = 0 and cos90 = 1, the matrix E simplifies to

[ ]
0 0 1 0
0 −1 0 0
,
1 0 0 0
0 0 0 1

which goes straight to the final orientation.

You might also like