Professional Documents
Culture Documents
TRANSFORMATION
will follow with the discussion on the compound transformation. The discussion
Transformation has been used widely in any geometric modeling. Moving a circle on
a screen requires transformation matrix, or even displaying the solid object also
the entities such as coordinates of the vertex. The geometrical properties can be
coordinate. Table 3.1 shows the representation of all the coordinate systems.
Type 2D 3D
3-1
Vector Coordinate x x
[x y] or
y [x y z] or y
z
Homogenous Coordinate x x
y
[x y 1] or y
[x y z 1] or
1 z
1
homogenous coordinate system is the suitable representation. The third axis for 2D
and fourth axis for 3D are in fact the homogenous axis. Basically, all the coordinates
can be scaled individually on this axis. As in the above example, the homogenous
coordinate is set to 1, it shows the scaling factor along the homogenous axis is 1 and
therefore, it will maintain its original coordinate system. Moreover, the introduction
a1 a 2 a3
x' y ' 1 x y 1b1 b2 b3 … (3.1)
c1 c 2 c3
a1 a 2 a3
b1 b2 b3 : Matrix
c1 c2 c3
3-2
Equation 3.1 shows the calculation using matrix. The matrix is applied to
x' x
y ' y … (3.4)
2D
1 1
x' x
y '
3 D y … (3.5)
z' z
1 1
there is only one vertex is used in the calculation, however in practical more vertices
3-3
are required. Therefore, Eq 3.2 and 3.3 are expanded to Eq. 3.6 and 3.7 to cater n
vertices.
x'1 y '1 1 x1 y1 1
x' y '2 1 x2 y2 1
2 … (3.6)
... ... 2D
x 'n y 'n 1 xn yn 1
Prior to apply the matrix transformation, the model can be represented into
10 20 1
20 20 1
30 30 1
30 20 1
3-4
0 0 10 1
10 0 0 1
0 10 0 1
(0,1,1)
0 0 0 1
(1,1,1)
1 0 0 1
(0,0,1)
1 1 0 2
(0,1,0)
... ... ... ...
Z
Y (1,1,0)
1 1 1 1
(0,0,0)
X (1,0,0)
This section discusses the matrix of the selected transformation. The application of
transformation. However, there are two differences between them, especially when
the transformation requires reference. The first one, when 2D transformation requires
a point as the reference, the same 3D transformation will require axis. The second one
3-5
Figure 3.1 Differences between the reference of 2D and 3D transformation
3.2.1 Translation
Translation will move one entity to another position. Figure 3.1 shows the translation
3.8, 3.9, and 3.10 can be used to calculate the position after translation is applied.
x' x x … (3.8)
y ' y y … (3.10)
3-6
z ' z z … (3.11)
1 0 0
T2 D 0 1 0 …(3.12)
x y 1
1 0 0 0
0 1 0 0
T3 D …(3.13)
0 0 1 0
x y z 1
3.2.2 Rotation
Rotation is a process to rotate an entity about rotation center. To rotate 2D entity, the
rotation center will become the reference, whilst for 3D rotation, the reference for
rotation will be an axis. Eq 3.14 and 3.15 will calculate the position of the vertex after
rotation is applied on 2D entities and Figure 3.2 illustrates the 2D rotation. The center
3-7
Figure 3.2 Rotation about a vertex
In the case of 3D rotation, the rotation is carried out on axis, x, y, and z axis.
The equation to calculate the position of the final entity after the rotation is applied
y' y … 3.20
z' z … 3.21
These equations can form the following 2D and 3D matrices are as the
following:
2D rotational matrix
cos sin 0
R2 D sin cos 0 …(3.22)
0 0 1
3-8
1 0 0 0
0 cos sin 0
R3 D X …(3.23)
0 sin cos 0
0 0 0 1
cos 0 sin 0
0 1 0 0
R3 DY …(3.24)
sin 0 cos 0
0 0 0 1
cos sin 0 0
sin cos 0 0
R3 DZ …(3.25)
0 0 1 0
0 0 0 1
All the equations (Eq 3.14 – 3.21) and matrices (Eq 3.22 – 3.23) are based on the
assumption the center of rotation are at origin (0, 0) for 2D rotation and at the
principal axis for 3D rotation. Any rotation that is carried out other than the origin for
2D and the principle axis for 3D, the rotational center should be transformed to the
reference center point or principal axis. Therefore, translation should be carried out to
transform the reference as the center or axis of rotation before applying the rotational
matrix.
The calculated vertices when rotation is applied is based on center or axis of the
translated one. However, rotation should be carried on the specified vertex or axis,
and therefore, the calculated vertices should be translated back to ensure rotation is
3-9
In all, any rotation that is not at the center point for 2D or principal axis for 3D,
translation is firstly carried out to make the reference point to be either center or
principal axis and it is followed with the application of the rotation transformation.
Finally, translation is carried out to make the calculated vertices to be referred to their
i. Translate the center or axis of rotation to its origin vertex or principle axis.
In the case of 2D, the coordinate of rotation center will be used as the reference,
whilst in the case of 3D, any vertex on the axis can be used as the reference. Let say,
the actual center of rotation is (x, y) and any point of the axis of rotation is (x, y, z).
The translation should be done to ensure (x, y) turns to (0, 0) and (x, y, z) turns to (0,
0, 0), therefore the translation matrix will be the negative value of every coordinate as
such x and y for 2D will be deducted by the value x and y for 2D translation and
1 0 0
2D
T2 D1 0 1 0 … (3.26)
x y 1
1 0 0 0
0 1 0 0
3D T3 D1 … (3.27)
0 0 1 0
x y z 1
Therefore, the original vertices (xi, yi) for 2D entities and (xi, yi, zi) for 3D entities will
be translated to (x’i, y’i) and (x’i, y’i, z’i) respectively using 3.27 and 3.28 for 2D and
3D translation respectively.
3-10
x'1 A y'1 A 1 x1 y1 1
x' y'2 A 1 x2 y2 1
2A 2 D1 … (3.28)
... ...
x'nA y'n A 1 xn yn 1
This translation process will make the reference center point and principle axis to
become (0, 0) and (0, 0, 0) respectively and this causes the rotational transformation
As the translation matric converts the center point to (0, 0) for 2D or (0, 0, 0) for
3D, rotation can be applied to the entities. Eq 3.29 and 3.30 calculates the vertices
when rotation matrix is applied that will transform (x’A, y’A) or (x’A, y’A, z’A) to (x’B,
3-11
In step I, the application of the translation matrix will translate all the
coordinates to its original position with the intention to make the center of rotation
will be at its origin or principle axis. Therefore, at this step, it will translate back all
the coordinates to their original position. Therefore, translation matrix is applied that
1 0 0
2D T2 D2 0 1 0 … (3.31)
x y 1
1 0 0 0
0 1 0 0
3D T3 D2 … (3.32)
0 0 1 0
x y z 1
The final vertices can be calculated using Eq 3.32 and 3.31 that will translate
(x’B, y’B) or (x’B, y’B, z’B) to (x’C, y’C) or (x’C, y’C, z’C) to (x’C, y’C) or (x’C, y’C, z’C).
Example 3.1
3-12
b) Calculate the transformed vertices if the polygon with the following vertices
are been transformed using the similar rotation in (a). The vertices are (10, 8),
Solution
(a) Since the shape is not rotated at (0,0), the translation must be applied before
T RT ,
comp 1 2
1 0 0
T1 0 1 0
4 5 1
1 0 0
T2 0 1 0
4 5 1
coordinate (4,5)
3-13
1 0 0 cos 35o sin 35o 0 1 0 0
comp 0 1 0 sin 35o cos 35o 0 0 1 0
4 5 1 0 0 1 4 5 1
0.819 0.574 0
0.574 0.819 0
3.591 1.39 1
10 8 1
P
polygon 16 8 1
13 13 1
x1 ' y1 ' 1
x '
2 y2 ' 1
Ppolygon comp
x3 ' y3 ' 1
10 8 1 0.819 0.574 0
16 8 1 0.574 0.819 0
13 13 1 3.591 1.39 1
7.2 10.9 1
12.1 14.3 1
6.8 16.7 1
Therefore, the respective transformed vertices will be (7.2, 10.9), (12.1, 14.3), and
(6.8, 16.7) and Figure 3.3 illustrates the process of the rotation graphically
3-14
Figure 3.3 Example 3.1
3.2.3 Mirror
Mirror is similar to process of sitting in a mirror, the reflection inside the mirror is
actually the result of the mirroring process. In 2D, x and y axis are used as mirror and
1 0 0
X axis M 2D X 0 1 0 … Eq 3.35
0 0 1
1 0 0
Y axis M 2 D Y 0 1 0 … Eq 3.36
0 0 1
Eq 3.36 – 3.38 are the matrices for 3D mirror based on the plane.
3-15
1 0 0 0
0 1 0 0
Plane XY T3 D XY … (3.37)
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
Plane YZ T3 D YZ … (3.38)
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
Plane XZ T3 D XZ … (3.39)
0 0 1 0
0 0 0 1
In mirror process, the mirror axis or planes are based on the principle axis. If the
mirror axis or planes are not based the principle axis, translation matrix should be
before to allow the mirror axis and plane to set on principle axis and after to convert
In 2D mirror process, the axis can translated into straight line equation as in the
following.
Therefore, if the mirror process is carried out using axis other than X or Y axis,
the mirror axis must be converted into X or Y axis that is having straight line equation
matrix before mirror process can take place. This translation process will convert the
If the mirror axis is parallel to X axis, the equation of the mirror axis will
3-16
y = Cx … (3.42)
1 0 0
T2 DX 1 0 1 0 … (3.43)
0 Cx 1
Then, the mirror can be applied as the mirror axis is equal to X principle axis.
After that translation will be applied to convert all the coordinates to its original
position. The translation matrix after the mirror will be as in equation 3.44.
1 0 0
T2 DX 2 0 1 0 … (3.44)
0 Cx 1
In the case of the mirror axis is parallel to Y axis, the equation for mirror axis
x = Cy … (3.45)
where Cy : constant
axis as principle y axis (or x = 0). Equation 3.46 will convert all the coordinates.
1 0 0
T2 DY 1 0 1 0 … (3.46)
C y 0 1
3-17
Then, mirror process using Y principle axis is carried out. It will be followed
with translation using equation 3.47 to make all the entities referred to their original
coordinate system.
1 0 0
T2 DY 2 0 1 0 … (3.47)
C y 0 1
Similarly, in the case of 3D mirror, translation before (T3D-1) and after ((T3D-2)
should be applied to homogenous matrix if the mirror plane is parallel to XY, YZ, or
1 0 0 0
0 1 0 0
T3 D XY 1 …(3.48)
0 0 1 0
0 0 Z xy 1
1 0 0 0
0 1 0 0
T3 D XY 2 … (3.49)
0 0 1 0
0 0 Z xy 1
1 0 0 0
0 1 0 0
T3 D YZ 1 …(3.50)
0 0 1 0
X yz 0 0 1
1 0 0 0
0 1 0 0
T3 DYZ 2 … (3.51)
0 0 1 0
X yz 0 0 1
3-18
Parallel to ZX plane: y coordinates is constant (Yzx)
1 0 0 0
0 1 0 0
T3 D ZX 1 …(3.52)
0 0 1 0
0 Yzx 0 1
1 0 0 0
0 1 0 0
T3 D ZX 2 … (3.53)
0 0 1 0
0 Yzx 0 1
translation are required. The non-parallel mirror axis or plane will be discussed
Example 3.2
A triangle with A (1,1), B (1,3) and C (2,2) has been subjected to the following
3-19
a) Write homogenous representation of the triangle.
triangle using axis x = 0 and the calculated the vertices after the mirroring
triangle using axis x = -2 and the calculated the vertices after the
Solution
1 1 1
P
triangle 1 3 1
2 2 1
1 0 0
M 2 D Y 0 1 0
0 0 1
3-20
x1 ' y1 ' 1
x '
2 y2 ' 1
Ptrianlg e M 2 DY
x3 ' y3 ' 1
1 1 1 1 0 0
1 3 1 0 1 0
2 2 1 0 0 1
1 1 1
1 3 1
2 2 1
Therefore A’ (-1, 1), B’ (-1, 3), and C’(-2, 2). Figure 3.5a illustrates graphically
matrik will be
x1 ' y1 ' 1
x '
2
y 2 ' 1 Ptrianlg e 1 M 2 D Y 2
x3 ' y 3 ' 1
1 1 1 1 0 0 1 0 0 1 0 0
1 3 1 0 1 0 0 1 0 0 1 0
2 2 1 2 0 1 0 0 1 2 0 1
5 1 1
5 3 1
6 2 1
Therefore A” (-5, 1), B”(-5, 3), and C”(-6, 2). Figure 3.5b illustrates graphically
3-21
(a)
(b)
3.2.4 Scaling
Scaling is carried out when we need to make certain entity bigger or smaller. The
scaling process is referred to one origin vertex for both 2D and 3D scaling. Figure 3.6
illustrates the concept of scaling graphically. As a result of the scaling, the final
coordinate is proportional to the scale that is applied, and this causes Eq 3.54 to 3.56
3-22
Figure 3.6 Scaling concept
x’ = Sx x … (3.54)
y’ = Sy y … (3.55)
z’ = Sz z … (3.56)
S X 0 0
S2 D 0 SY 0 … (3.57)
0 0 1
S X 0 0 0
0 SY 0 0
S3 D … (3.58)
0 0 SZ 0
0 0 0 1
Matrices in Eq 3.57 and 3.58 indicate the scaling can be done on individual axis.
However, more commonly, the scale for all the axis is equal and therefore both
3-23
C 0 0
S2 D 0 C 0 … (3.59)
0 0 1
C 0 0 0
0 C 0 0
S3 D … (3.60)
0 0 C 0
0 0 0 1
Therefore, since the origin of the scaling must be at (0, 0) or (0, 0, 0) for 2D and
3D respectively, translation before and after applying the scaling must be carried out
Example 3.3
Figure 3.7b. Establish the transformation matrices for this transformation. The scaling
Solution
Solution
3-24
The homogenous representation of the cube is
0 0 0 1
1 0 0 1
1 1 0 1
0 1 0 1
M
0 0 1 1
1 0 0 1
1 1 1 1
0 1 1 1
To create the shape as in Figure 3.7b, the cube must be firstly scaled by 4 along the Y
axis and then, followed with the translation by x = 4. Therefore, the transformation
will be
comp S T
1 0 0 0 1 0 0 0
0 4 0 0 0 1 0 0
0 0 1 0 0 0 1 0
0 0 0 1 4 0 0 1
1 0 0 0
0 4 0 0
0 0 1 0
4 0 0 1
3-25
M ' M Tcomp
0 0 0 1
1 0 0 1
1 1 0 1 1 0 0 0
0 1 0 1 0 4 0 0
0 0 1 1 0 0 1 0
1 0 0 1 4 0 0 1
1 1 0 1
0 1 1 1
4 0 0 1
5 0 0 1
5 4 0 1
4 4 0 1
4 0 1 1
5 0 0 1
5 4 0 1
4 4 1 1
3.2.5 Shearing
Shearing is a process to translate entity along certain axis and the amount of
translation increases linearly based on the height of point above the reference axis.
If the shearing is carried out along the X axis, any point on X principle axis will
not be translated. The point above the X principle be translated linearly by a product
3-26
using equation 3.61, whilst there is no change in y coordinate. This is graphically
y' y … (3.62)
Figure 3.8b illustrates the similar shearing process along the Y axis. Hence, the
y ' x y … (3.64)
1 0 0
Sh2 DX 1 0 … (3.65)
0 0 1
1 0
Sh2 DY 0 1 0 … (3.66)
0 0 1
In 3D, the shearing process can be done along the x axis, y axis, or z axis. If the
shearing is carried out along the plane XY, translation will be carried out along the X
and Y axis and at the same time, z coordinate will be maintained. Therefore, the
3-27
y ' x z … (3.68)
z' z … (3.69)
1 0 0 0
0 1 0 0
S3 DXY … (3.70)
1 0
0 0 0 1
1 0 0 0
1 0
Plane XZ: S3 DXZ … (3.71)
0 0 1 0
0 0 0 1
1 0
0 1 0 0
Plane YZ: S3 DYZ … (3.72)
0 0 1 0
0 0 0 1
Example 3.4
matrix, calculate all the respective points that form the italic letter M.
3-28
Figure 3.9 Profile M
Solution
0 0 1
0 40 1
10 40 1
20 30 1
30 40 1
M
40 40 1
40 0 1
30 0 1
30 25 1
20 15 1
10 25 1
10 0 1
1 0 0
Sh2 DX sin( 15 ) 1 0
o
0 0 1
3-29
The italic M vertices are
1 0 0
M * M sin( 15 ) 1 0
o
0 0 1
0 0 1
10.4 40 1
20.4 40 1
27.8 30 1
40.4 40 1
50.4 40 1
40 0 1
30 0 1
36.5 25 1
23.9 15 1
16.5 25 1
10 0 1
3.2.5 Mapping
The application o global and local coordinate systems are been used during
modelling. The need of the local coordinate system is due to the need of drawing
entities on different plane. When the entities are drawn using the local coordinate
system, the coordinates of the vertices will be referred to the local coordinate system.
These entities must maintain the relationship with the global coordinate system and
mapping process will maintain the relationship between two coordinate system.
Figure 3.10 shows the two coordinate systems and point P can be described by
system, mapping matrix will calculate the coordinate of point P when is the referred
3-30
Figure 3.10 Mapping concept
Normally the new coordinate will be rotated and translated, therefore the
equations:
a11 a21 0
2D Mapping M 2D a12 a22 0 … (3.73)
x y 1
For 2D matrix, a11 – a22 and 3D matrix a11 – a33 are the rotational matrix, while
the last row of both matrices is the translation matrix. Therefore, it can be furthered
cos sin 0
2D Mapping M 2D sin cos 0 … (3.75)
x y 1
3D Mapping
3-31
1 0 0 0
0 cos sin 0
R3 D X …(3.76)
0 sin cos 0
x y z 1
cos 0 sin 0
0 1 0 0
R3 DY …(3.77)
sin 0 cos 0
x y z 1
cos sin 0 0
sin cos 0 0
R3 D Z …(3.78)
0 0 1 0
x y z 1
Parameters
There are two parameters that need to follow convention; amount of translation in
every axis and angle for rotation. In order to make the convention, we have to
understand the foundation. Figure 3.10 shows that point P needs to be mapped to the
coordinate system is (3, 2). Currently P is (x, y) when it is referred to the principal
X’Y’ coordinate system. Similar situation occurs on the origin of both coordinate
systems, both origins should be (0, 0). To make the X’Y’ coordinate system to be (0,
0), the coordinate should be translated by Dx = -3 and Dy = -2. Therefore, the amount
of the translation needed will be the negative value of the origin of mapped (X’Y’)
coordinate system.
3-32
The foundation of the translation is that it should be inverse to the amount of
translation of the mapped cs. Similar for angle of rotation, it should be negative to
conventional Right Hand Rule and as a result for the case in Figure 3.10, the rotation
angle should be -30o. Please take note that Right hand rule is used to set the positive
that the axis of x, y, and z is based on right hand rule. However, the mapping may
occur and the coordinate system is not following the conventional one. Mapping the
Figure 3.11 shows the default position of the conventional and computer
graphic system coordinate system. The origin of conventional coordinate system will
be positioned at the bottom left of the screen, whilst the origin of the graphic screen
coordinate system is at the top left of the screen. Visually, we can say that only the y
same angle, these matrices should be modified to cater the need of not having all the
axis to be rotated at the same angle. Therefore, the matrices can be expanded to
individual rotation on each axis on each column as stated in equation 3.79 for 2D and
nx n y 0
2D Mapping M 2D ox oy 0 … (3.79)
x y 1
nx n y nz 0
o o y oz 0
3D Mapping M 3D x … (3.80)
px p y pz 0
x y z 1
The first column is the transformation needed for x coordinate, the second and
the third column are the transformation needed for y and z coordinates respectively.
Referring back to the problem in Figure 3.11 and assuming the translation matrix has
been solved, point P is the point using the graphic screen coordinate system and point
P’ is the mapped point P using the principle coordinate system. The relationship
x' = x
y’ = -y
Similarly, the mapping matrix can be derived from the rotational matrix,
where angle of rotation 0o and 180o are used for x and y axis respectively.
Example 3.5
Figure 3.12 shows a square is mirrored using axis 2. Answer the following questions
ii. Calculate the coordinates of the mirror square using the compound
iii. Calculate the coordinates of the mirror square using the mapping transformation
matrix
3-35
Solution
20 20 1
30 20 1
[K ]
30 10 1
20 10 1
To get all the coordinates of the square after being mirrored, the current CS have to go
a) The coordinate system must move to point (10, 5). This causes the point (10,
1 0 0
T1 0 1 0
5 10 1
3-36
b) Rotate the coordinate system by -40o and this causes the mirror axis and x axis
c) Mirror the square using x axis as the mirror axis as shown in Figure 3.13c.
1 0 0
M 0 1 0
0 0 1
Figure 3.13e.
1 0 0
T2 0 1 0
5 10 1
3-37
Figure 3.14 Method 2
a) Mapping the square based on the X’Y’ coordinate system as shown in Figure
3.14a.
In mapping transformation matrix, two parameters, angle and translation, are required.
= -40O
b) Mirror the square based on X’ axis as the mirror axis as shown in Figure 3.xxb.
1 0 0
M 0 1 0
0 0 1
3-38
c) Mapping back the square after the mirror using the original coordinate system
= 40O
Dx2 = 5
Dy2 = 10
0.714 0.985 0
comp 0.985 0.714 0
5.716 6.812 1
Example 3.6
By default every window created has its own Coordinate System (CS) as shown in
Figure 3.15a and the position is set by the raster position such as (10,10) means 10
If one raster is equal to 0.01mm and the size of the window is 1000 raster vertical and
3-39
Develop the transformation required to calculate the position of the entities in raster
based CS (Figure 3.15a) but for visualization purposes, it seems to refer to Normal
CAD window CS (Figure 3.15b). The entities are comprises four lines to draw a2 if a
2 mm square with the bottom left corner will be at (1, 1). The position of the Normal
Y
default window, raster based window setting.
Normal CAD window, unit (mm/ inch) based window setting
Solution
The vertices of the square in mm are (1, 1), (3, 1), (3, 3), and (1, 3).
Therefore, in raster unit, the vertices are (10, 10), (30, 10), (30, 30), and (10, 30) and
10 10 1
30 10 1
[K ]
30 30 1
10 30 1
The next step is to apply the mapping matrix. Since the position of CAD package CS
is at (0, 2000) of the raster CS, therefore x = 0 and y = 2000. Therefore, the
mapping matrix is
3-40
1 0 0
M 2D 0 1 0
0 2000 1
10 10 1
30 1 0
1
0
0 1 0
10
K '
30 30 1
0 2000 1
10 30 1
10 1990 1
30 1990 1
30 1970 1
10 1970 1
Therefore, to draw a 2 mm square, the square comprise of (10, 1990), (30, 1990), (30,
1970), and (10, 1970) vertices must be drawn on the raster-based screen.
More often, multiple transformations are applied. The combination of these matrices
. ...
comp 1 2 n … (3.81)
P' Pcomp
The main question arises whether the compound transformation should be order
or it does not matter. Figure 3.16 shows the application of translation and rotation
matrix. Figure 3.16a shows the translation is applied first and then follow with the
3-41
rotation, whilst Figure 3.16b shows the rotation is applied first and then follow with
the translation. As a result, the mapped shape is not on the same position, which
means that
Most common, we will draw solid object in 3D. During manipulation during
modeling or for documentation purposes, the need to project the model from different
view is required. In changing the view point, transformation is applied to model. The
Orthographic drawing is created when the object is projected on the basic three planes
that are perpendicular to each other. The view point is assumed to be at infinity
distance and this projection ray to be parallel to each other, therefore the projection is
3-42
one of the parallel perspective projections. As the projection ray is parallel to each
other, it causes the projection is having the true length of the object. Figure 3.17
Furthermore, the plane for the orthographic projection is normal to the view ray.
The basic of orthographic projection is when the object is projected to the three basic
1 0 0 0
0 1 0 0
Plane XY OXY … (3.83)
0 0 0 0
0 0 0 1
0 0 0 0
0 1 0 0
Plane YZ OYZ … (3.84)
0 0 1 0
0 0 0 1
3-43
1 0 0 0
0 0 0 0
Plane ZX OZX … (3.85)
0 0 1 0
0 0 0 1
additional views, mapping of the coordinate system is required before the projection
transformation matrix is applied to create the views. Figure 3.18 shows the application
matrix.
Example 3.7
Figure 3.19a is a 3D part. Using the 3D part, develop the orthographic drawing. The
bottom left vertex of the orthographic will be at (0, 0) of the 2D environment. The
The task is to develop the transformation matrices that is able to transform the vertices
of 3D part into vertices that can be used to develop the orthographic drawing.
3-44
l
(a) (b)
Solution
There are 10 vertices of the part and the vertices are (0, 0, 0), (30, 0, 0), (30, 0, 30), (0,
0, 30), (0, 30, 0), (30, 30, 0), (30, 30, 15), (15, 30, 30), (0, 30, 30), and (30, 15, 30)
0 0 0 1
30 0 0 1
30 0 30 1
0 0 30 1
0 30 0 1
M
30 30 0 1
30 30 15 1
15 30 30 1
0 30 30 1
30 15 30 1
FRONT VIEW
3-45
To create the front view, the part needs to project onto XY plane and by taking only
0 0 0 1
30 0 0 1
30 0 30 1
0 0 30 1 1 0 0 0
0 1 0 1 0 0
M*
30 0
1 0 0 0 0
30 30 0
30
30 15 1 0 0 0 1
15 30 30 1
0 30 30 1
30 15 30 1
0 0 0 1
30 0 0 1
30 0 0 1
0 0 0 1
0 30 0 1
30 30 0 1
30 30 0 1
15 30 0 1
0 30 0 1
30 15 0 1
TOP VIEW
To create the top view, rotation is carried along the X axis by 90o. The rotation causes
the plane ZX to be mapped onto plane XY. Then, 3D part is projected onto XY plane.
3-46
0 0 0 1
30 0 0 1
30 0 30 1
0 0 30 1 1 0 0 0 1 0 0 0 1 0 0 0
0
1 0 cos 90o 0 0 1 0 0 0 1 0 0
o
30 0 sin 90
M*
30 30 0 1 0 sin 90o cos 90o 0 0 0 0 0 0 0 1 0
30
30 15 1 0 0 0 1 0 0 0 1 0 70 0 1
15 30 30 1
0 30 30 1
30 15 30 1
0 70 0 1
30 70 0 1
30 40 0 1
0 40 0 1
0 70 0 1
30 70 0 1
30 55 0 1
15 40 0 1
0 40 0 1
30 40 0 1
SIDE VIEW
To create the side view, the part must be rotated by -90o along Y axis prior applying
3-47
0 0 0 1
30 0 0 1
30 0 30 1
0 0 30 1 cos( 90o ) 0 sin( 90o ) 0 1 0 0 0 1 0 0 0
0 1 1 0 0 0 1 0 0
M*
30 0
0
1 sin( 90o )
1 0 0 0
30 30 0 0 cos( 90o ) 0 0 0 0 0 0 0 1 0
30
30 15 1 0 0 0 1 0 0 0 1 70 0 0 1
15 30 30 1
0 30 30 1
30 15 30 1
70 0 0 1
70 0 0 1
40 0 0 1
40 0 0 1
70 30 0 1
70 30 0 1
55 30 0 1
40 30 0 1
40 30 0 1
40 15 0 1
Table 3.3 shows the orthographic projection of each vertex on each view
3-48
(0, 30, 30) (0, 30) (0, 40) (40, 30)
Axometric project will display the model in 3D on 2D projected plane. It is also one
the true length of the object, the axometric projection may project a shorten projection
of the objects. To create the axometric, the view point must be at angle a on plane
the following:
Based on the angle a and b, the axometric projections can be further classified
Isometric projection: when all the axes have been shorten at specific scale.
Dimetric projection: two of the axes have been shorten at the same scale.
Trimetric: when all the axes have been shorten at different scale.
In the following, it will discuss the manipulation of angle a and b to create these
projections.
Isometric Projection
Figure 3.21 shows a cube has been projected into isometric projection. To create an
equal angle between axes and horizontal line on the right and left sides, the model
must rotate by 45o about Y axis (angle a). However, angle b from the plane XY will
determine the angle Both angle b and are governed by h and w, and the equations
3-50
Figure 3.21 Basic isometric projection
h
sin 1
w
h
tan 1
w
3 to the h. Based on the above equations, angle should be 30o, and angle b is
35.26o. In all, for isometric projection, angle a is 45o, angle b is 35.26o, and angle
is 30o. Figure 3.22 show the possible isometric projections and the angle of a, b, and
.
3-51
Figure 3.22 Possible isometric projection with angle a, b, and
Example 3.8
Calculate the vertices of box with 4 unit x 4 unit x 2 unit when the box is projected
Solution
0 0 0 1
0 0 2 1
4 0 0 1
4 0 2 1
K
4 4 0 1
4 4 2 1
0 4 0 1
0 4 2 1
3-52
0.71 0.41 0 0
0 0.82 0 0
0
0.71 0.41 0 0
0 0 0 1
0 0 0 1
0 0 2 1
4 0 0 1 0.71 0.41 0 0
1 0 0
K
*
4
4 0
4
2
0
0.82
1 0.71 0.41
0
0 0
4 4 2 1 0 0 0 1
0 4 0 1
0 4 2 1
0 0 0 1
1.42 0.82 0 1
2.83 1.63 0 1
K
* 4.24 0.82
2.83 4.9
0
0
1
1
4.24 4.08 0 1
0 3.27 0 1
1.42 2.45 2 1
3-53
Length along X axis:
Line from (0, 0, 0) and (4, 0, 0) will be transformed to (0, 0) and (2.83, 1.63),
Line from (0, 0, 0) and (0, 4, 0) will be transformed to (0, 0) and (0, 3.27),
Line from (0, 0, 0) and (0, 0, 2) will be transformed to (0, 0) and (1.42, -0.82),
Dimetric Projection
Isometric projection will make the axes to be shorten at the same scale. Howeer, when
two of the axes have been shorten at different scale from the other axis, it projects into
a projection that is called as dimetric. More frequent, the x axis will be scaled
differently and this causes the projection is not symmetric. Therefore, the rotation
angle a should be larger than 45o. Figure 3.25 show the possible dimetric projections
3-54
Figure 3.25 Possible dimetric projection with angle a, b, and
Dimetric projection will display the model is more realistic manner than
isometric projection.
Example 3.9
3-55
ii) is 70o, and is set to 40o, 30o, 20o, 10o
Solution (a)
Based on equation 3.86, by varying the and set = 24o, the resultant vertices are
The dimetric projections based on the various angle are shown in Figure 3.26.
3-56
Figure 3.26 The dimetric projections of various
Solution (b)
Similarly, equation 3.86 is used, by setting = 70o and varying the , the resultant
vertices are shown in Table 3.5. Figure 3.27 shows each dimetric projection.
3-57
(4, 4, 2) (3.247, 5.045) (3.247, 4.983) (3.247, 4.784) (3.247, 4.454)
transformation can also have other applications. Two of the applications are animation
animation and Section 3.6.2 will discuss the application on modeling purposes.
3.6.1 Animation
3-58
applied to create the animation. In the following it demonstrates the movement of the
a car according the specified path as shown in Figure 3.28. The vehicle will brake
until it stops before turning to the right and then the vehicle takes the corners at the
same time accelerates. Finally the vehicle will continue to accelerate to reach the
desire velocity and the vehicle will travel at the constant velocity.
Based on the travelling of the vehicle, the path can be divided into four sections.
The sections are straight vertical path during braking, quarter circle path during
turning to the right, straight path during accelerating after taking the corner, and
finally straight path during travelling at the constant velocity. The initial homogenous
representation of the path will be the vertices at the starting point for each path and
the application of the transformation matrices will be based on the path and the
position of the vehicle based on the time using dynamic of motion. Example 3.10 will
demonstrate further to calculate the vertices for the first and the second path.
Example 3.10
The first path in Figure 3.28 is 75 m which the vehicle will brake to stop from initial
velocity of 10 m/s. The vehicle will then accelerate to reach 3 m/s at the end of path 2
3-59
based the path generated by radius of the quarter circle of 4.5 m. Then, the vehicle
will accelerate to 10 m/s within 30 m and finally travel constantly at 10 m/s for the
Solution
V x y 1
V 0
p1 0 1
The time taken for the vehicle to stop from initial velocity of 20 m/s will be based on
the
v u at
at v u
s ut 0.5at 2
s t (u 0.5at )
s t max (u 0.5(v u ))
s
t max
0.5(u v)
If the position of the vehicle is calculated based on every second, s(t) for t = 0 to 15
sec will be
3-60
(v u )
ay
t max
s x (t ) u x t 0.5a x t 2
s y (t ) u y t 0.5a y t 2
[V p*1 ] [V ][T ]
1 0 0
[0 0 1] 0 1 0
S x (t ) S y (t ) 1
Table 3.6
3-61
7 (0, 53.67) 15 (0, 75)
For the second path, the starting point is at the point where the vehicle stops which is
Similar, approach as path is used here except the motion will be in angular.
tmax
0.5(o 1 )
tmax = 4.71 sec
0.5(o )
(t ) ot 0.5t 2
The rotation transformation will be (negative angle due to the clockwise direction)
cos( (t )) sin( (t )) 0
R2 D sin( (t )) cos( (t )) 0
0 0 1
V 0
p2 75 1
3-62
The center of rotation will be at (4.5, 75). Since the center of rotation is not the origin,
the
1 0 0 cos( (t )) sin( (t )) 0 1 0 0
V
*
p2
0 75 1 0 1
0 sin( (t )) cos( (t )) 0 0 1 0
4.5 75 1 0 0 1 4.5 75 1
By inserting the time, the position of the vehicle at the specified is listed in Table 3.7.
Position (0, 75) (0.01, 75.32 ) (0.18, 76.26) (0.88, 77.68) (2.59, 79.07) (4.50, 79.50)
Path 3
Similar approach as in calculating the position of vehicle for Path 2, the initial known
variables will be
Distance travel s = 30 m
Homogeneous representation of the vehicle: V p 3 4.5 79.5 1
Based on these variables, time taken to travel will be 4.62 sec (tmax)
Therefore, the position of the vehicle with respect to time will be in Table 3.8
3-63
Position (4.5, 79.5) (8.26, 79.5 ) (13.53, 79.5) (20.33, 79.5) (28.63, 79.5) (34.5, 79.50)
Path 4
Distance travel s = 50 m
Homogeneous representation of the vehicle: V p 3 3 4.5 79.5 1
Therefore, the position of the vehicle with respect to time will be in Table 3.9
Position (34.5, 79.5) (44.5, 79.5 ) (54.5, 79.5) (64.5, 79.5) (74.5, 79.5) (80.7, 79.5)
3-64
Figure 3.29 Vertices of the path
For the purposes of modelling, it is easier to model the part separately. This is because
it is common to have one reference point on the part and all the dimension will be
referred to this reference. Therefore, it will be easier, the origin of axis (0, 0, 0) is
regarded as the reference point. After the part is drawn, then transformation matrices
will be applied to the part to position the part on the intended place.
Figure 3.29 shows application of the transformation to model robotic arm. The
robotic comprises Arm 1, Arm 2, and Gripper. To ease the modelling process, each
part will be modelled separately using the origin (0, 0) as the reference point as shown
in Figure 3.29a. When the robotic arm is assembled, it should be assembled as shown
in Figure 3.29b. Therefore, the transformation matrices are used to assemble the
robotic arms.
3-65
cos(45o ) sin( 45o ) 0
V *
arm1
Varm1 sin( 45o ) cos(45O ) 0
0 0 1
To model Arm 2, the arm must be rotated by 20o counter clock wise direction and
To model the gripper, the gripper must be rotated 30o clock wise direction and
Example 3.11
The arms are modelled using API function that is able to create a cube of 1 x 1 x 1.
Therefore, the task is to model the upper and lower arms to be at intended position
shown in Figure 3.30 from the basic cube of 1 x 1 x 1. The size of the lower arm is 2 x
3-66
Figure 3.30 Simplified robotic arm
Solution
The steps to model the lower and upper arm are as the following
Since the arm is built from a cube 1 x 1 x 1, scaling of the cube accordingly will
2 0 0 0
0 2 0 0
L
1*
arm Larm
0 0 20 0
0 0 0 1
2 0 0 0
0 0
U
1*
arm U arm
0
2
0
0
5 0
0 0 0 1
Step 2: Translate the upper arm at the end of the lower arm (Figure 3.31b)
1 0 0 0
0 0
U U
2*
arm
1*
arm
0
1 0
0 1 0
0 0 20 1
Step 3: Rotate lower and upper arm along –ve Y axis by 60o (Figure 3.3c)
3-67
cos(30o ) 0 sin( 60o ) 0
L L
3* 1* 0
sin( 30o )
1 0 0
0
arm arm
0 cos(30o )
0 0 0 1
Step 4: Rotate upper arm along +ve Y axis by 10o (Figure 3.3d)
The center rotation is at the end of the lower arm which is (20 cos(60o), 20 sin(60o)).
Therefore, translation must be applied before and after the rotation matrix.
Step 5: Rotate the lower and upper arm by 15o along +ve Z axis (Figure 3.31e)
3-68
Figure 3.31 Steps to model the robotic arm
especially the open loop mechanism. The main interest in the kinematic study is the
position of the arm. The movement of the arm depends on the joint types. Figure 3.32
3-69
Figure 3.32 Types of joints
The prismatic joint will only allow the translation, whilst the revolutional joint will
only allow the linkage at the center of the joint. Cylindrical joint will allow translation
and revolution. The translation will be along the axis of the cylindrical joint and the
revolution will be rotated at the center of the cylinder. Finally spherical joint will
Figure 3.33 shows one example of robotic arms. The arms comprises all
revolutional joints except at the gripper which is prismatic. Even with the
3-70
Example 3.12
Figure 3.34 shows one robotic arms. Develop the matrices that will calculate the
position of point O based on angle , , and and the length of each arms L1, L2, and
L3.
Solution
position of A must be calculated first, then follows with the calculating the position of
Assuming all the linkages are positioned horizontally along the X axis, therefore, the
Linkage 1: L L1
1 0 1
Linkage 2: L L2
2 0 1
Linkage 3: L L3
3 0 1
Calculating position B
3-71
cos sin 0
B x By
1 L1 0 1 sin cos 0
0 0 1
Calculating position B
cos( ) sin( ) 0 1 0 0
C x Cy
1 L 2 0 1 sin( ) cos( ) 0 0 1 0
0 0 1 Bx By 1
Therefore, position O
cos( ) sin( ) 0 1 0 0
O x Oy
1 L3 0 1 sin( ) cos( ) 0 0 1 0
1 0 0
x'
i y '
i
1 Li 0 1 required 0
1 0
xi 1 yi 1 1
3-72