Professional Documents
Culture Documents
CHAPTER 3
THREE-DIMENSIONAL TRANSFORMATION
3.1 Introduction
A three-dimensional object has a three-dimensional geometry, and therefore, it
requires a three-dimensional coordinate transformation. A right-handed
coordinate system is used to carry out a 3-D transformation.
The scaling and translation transformations are essentially the same as twodimensional transformations. However, the points matrix will have a non-zero 3rd
column. Additionally, the transformation matrices contain some non-zero values
in the third row and third column, as shown below.
[Ts] =
sx
0
0
0
0
sy
0
0
0
0
sz
0
0
0
0
1
(3.1)
Where, sx, sy, sz are scale factors along x, y, and z-axes, respectively.
Translation Transformation matrix:
[Tt] =
1
0
0
x
0
1
0
y
0
0
1
z
0
0
0
1
(3.2)
3-1
[Trz] =
[Trx] =
[Try] =
cos
-sin
0
0
sin
cos
0
0
0
0
1
0
0
0
0
1
1
0
0
0
0
cos
-sin
0
0
sin
cos
0
0
0
0
1
cos
0
sin
0
0
1
0
0
-sin
0
cos
0
0
0
0
1
(3.3)
(3.4)
(3.5)
3-2
[P] =
0
2
2
0
0
2
2
0
0
0
2
2
0
0
2
2
0
0
0
0
2
2
2
2
1
1
1
1
1
1
1
1
Solution: The new coordinates of the cube are found by the product of the points matrix
and the scaling matrix,
0
2
2
0
0
2
2
0
0
0
2
2
0
0
2
2
0
0
0
0
2
2
2
2
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
1
1
0
0
1
1
0
0
0
1
1
0
0
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
3-3
Note: Clockwise and counter-clockwise directions are determined by the right-handthumb rule.
Example 2: The points matrix for a wedge is given as follows. Rotate the wedge 300 ccw
around the x-axis and then 450 cw around the y-axis. The points matrix is,
[P] =
0
0
4
4
0
0
0
0
0
0
3
3
0
2
0
2
0
2
1
1
1
1
1
1
Solution: First, we will rotate the wedge around the x-axis, and then about the y-axis.
Rotation about the x-axis,
[P*]x =
0
0
4
4
0
0
0
0
0
0
3
3
0
2
0
2
0
2
1
1
1
1
1
1
1
0
0
0
0
cos(300)
-sin(300)
0
0
sin(300)
cos(300)
0
0
0
0
1
3-4
[P*] =
0
0
4
4
0
0
0
0
0
0
3
3
0
2
0
2
0
2
cos(-450)
0
sin(-450)
0
1
1
1
1
1
1
1
0
0
0
0
1
0
0
-sin (-450)
0
cos(-450)
0
0
cos(300)
-sin(300)
0
0
sin(300)
cos(300)
0
0
0
0
1
0
-1.22
2.82
1.6
0
0
0
1
0
-1
0
-1
0
1.22
2.82
4.05
Note that, rotation about the axis is positive and hence, +300. Where as rotation about the
y-axis is negative 450.
3-5
1
1
1
1
F(1,4,6)
y
2
E(0,2,2)
2
x
(0,0,0)
z
Solution: We will make use of the seven-step procedure outlined above and write the
applicable transformation matrix in each step. After we have generated all the
transformation matrices, we will solve for the new coordinates of the rectangle at the end
of the 7th step.
3-6
1. Translate the given axis so that it will pass through the origin
Translation of the line EF to origin is given as,
0
2
2
0
0
0
2
2
0
0
0
0
1
1
1
1
and [Tt] =
1
0
0
0
0
1
0
-2
0
0
1
-2
0
0
0
1
a =1
b =2
b
c =4
[Tr] =
1
0
0
0
0
cos
-sin
0
0
sin
cos
0
0
0
0
1
1
0
0
0
0
.8944
-.4472
0
0
.4472
.8944
0
0
0
0
1
3-7
[Tr] =
cos
0
sin
0
0 -sin
1 0
0 cos
0
0
0
0
0
1
0.9759
0
0.2182
0
0
1
0
0
-0.2182
0
0.9759
0
0
0
0
1
[Tr] =
cos
-sin
0
0
sin
cos
0
0
0
0
1
0
0
0
0
1
0.866
-0.5
0
0
0.5
0.866
0
0
0
0
1
0
0
0
0
1
3-8
5. Reverse of Step 3
In this step we will rotate the frozen box an angle -, about the y-axis. Since cos (-) =
cos, and sin(-) = -sin(), the transformation matrix is,
[Tr]- =
cos(-)
0
sin(-)
0
1
0
1
0
0
-sin(-)
0
cos(-)
0
0
0
0
0
0.9759
0
-0.2182
1
0
1
0
0
0.2182
0
0.9759
0
6. Reverse of Step 2
Rotate the box an angle - about the x-axis. The transformation matrix is,
[Tr]- =
1
0
0
0
0
cos(-)
-sin(-)
0
0
sin(-)
cos(-)
0
0
0
0
1
1
0
0
0
0
0.8944
0.4472
0
0
-0.4472
0.8944
0
0
0
0
1
7. Reverse of Step 1
In this final step, we will translate the box so that the corner E will move back to its
original coordinates (0,2,2). The transformation matrix is,
[T-t] =
1
0
0
0
0
1
0
2
0
0
1
2
0
0
0
1
3-9
0
0
0
1
This completes all the seven steps that are necessary to rotate the rectangle about the line
EF. The new coordinates of the rectangle are given by the equation,
[P*] = [P] [Tt] [Tr] [Tr] [Tr] [Tr]- [Tr]- [T-t]
The concatenated transformation matrix is,
0
2
2
0
0
0
2
2
-0.2913
1.5712
1.2226
-0.6399
0
0
0
0
1
1
1
1
-0.0909
0.2359
2.2051
1.8783
0.9312
-0.1743
0.3199
-0.2913
0.1634
0.9846
0.0609
-0.0909
0.9312
-0.1743
0.3199
-0.2913
0.1634 -0.3256
0.9846 -0.0044
0.0609 0.9454
-0.09090.1179
0.1179
-0.5334
-0.5421
0.1092
-0.3256
-0.0044
0.9454
0.1179
0
0
0
1
0
0
0
1
1
1
1
1
3-10