Professional Documents
Culture Documents
Homogenous Coordinate
System
▪ Homogeneous coordinates
▪ Composition of transformations
1) Modeling
2) viewing
Homogenous Coordinates
Where x’= x+ tx
And y’= y + ty
z’=z+ tz
Translation in 3D
x’ 1 0 0 tx x
y’ 0 1 0 ty y
z’ = 0 0 1 tz z
1 0 0 0 1 1
Translation in 3D
Translation in 3D
• X=rcosϕ......(1)
• Y=rsinϕ......(2)
• x′=rcos(ϕ+θ)=rcosϕcosθ−rsinϕsinθ.......(3)
• y′=rsin(ϕ+θ)=rsinϕcosθ + rcosϕsinθ.......(4)
2D ROTATION
• Substituting equation 1 & 2 in 3 & 4 respectively, we will get
• x′=xcosθ−ysinθ
• y′=xsinθ+ycosθ
2D ROTATION
-sinθ cosθ
OR, P’ = P . R
2D ROTATION
• The rotation angle can be positive and negative.
• For positive rotation angle, we can use the above rotation matrix. However, for negative
angle rotation, the matrix will change as shown below −
• R= cos(−θ) sin(−θ)
− sin(−θ) cos(−θ)
x’ 1 0 0 0 x
y’ = 0 cosθ – sinθ 0 y
z 0 sinθ cosθ 0 z
1 0 0 0 1 1
Y-AXIS ROTATION
• The equation for Y-axis rotaion
• x’ = x cosθ + z sinθ
• y’ = y
• z’ = z cosθ - x sinθ
x’ cosθ 0 sinθ 0 x
y’ = 0 1 0 0 y
z’ -sinθ 0 cosθ 0 z
1 0 0 0 1 1
Z-AXIS ROTATION
• The equation for Y-axis rotaion
• x’ = x cosθ – y sinθ
• y’ = x sinθ + y cosθ
• z’ = z
x’ cosθ -sinθ 0 0 x
y’ = sinθ cosθ 0 0 y
z’ 0 0 1 0 z
1 0 0 0 1 1
2D SCALING
• To change the size of an object, scaling transformation is used. In the scaling process,
you either expand or compress the dimensions of the object. Scaling can be achieved by
multiplying the original coordinates of the object with the scaling factor to get the
desired result.
• Let us assume that the original coordinates are X,Y, the scaling factors are (SX, SY), and
the produced coordinates are X′,Y′. This can be mathematically represented as shown
below −
• X' = X . SX and Y' = Y . SY
2D SCALING
• The scaling factor SX, SY scales the object in X and Y direction
respectively. The above equations can also be represented in matrix
form as below −
• (X′Y′)= (XY) Sx 0
0 Sy
[X' = X . SX and Y' = Y . SY ]
OR P’ = P . S
2D SCALING
• Where S is the scaling matrix. The scaling process is shown in the
following figure.
2D SCALING
• x’ = x . sx
• y’ = y . Sy
• z’ = z . Sz
• Ssx, sy, sz
3D SCALING
x’ Sx 0 0 0 x
y’ = 0 Sy 0 0 y
z’ 0 0 Sz 0 z
1 0 0 0 1 1
Reflection in 2 D
• Reflection is the mirror image of original object. In other words, we can say that it is a
rotation operation with 180°. In reflection transformation,the size of the object does
not change.
• The following figures show reflections with respect to X and Y axes, and about the
origin respectively.
Reflection in 2 D
Reflection in 2 D
3D REFLECTION
• Reflection may be an x-axis, y-axis , z-axis and also in the planes xy-
plane, yz-plane , and zx-plane.
1 0 0 0
0 -1 0 0
0 0 -1 0
0 0 0 1
3D REFLECTION
•Reflection about y-axis:-
•y’=y x’=-x z’=-z
-1 0 0 0
0 1 0 0
0 0 -1 0
0 0 0 1
3D REFLECTION
• Reflection about z-axis:-
• x’=-x y’=-y z’=z
-1 0 0 0
0 -1 0 0
0 0 1 0
0 0 0 1
2 D Shearing
• A transformation that slants the shape of an object is called the shear
transformation. There are two shear transformations X-Shear and Y-
Shear. One shifts X coordinates values and other shifts Y coordinate
values. However; in both the cases only one coordinate change its
coordinates and other preserves its values. Shearing is also termed
as Skewing.
X-Shear
• The X-Shear preserves the Y coordinate and changes are made to X
coordinates, which causes the vertical lines to tilt right or left as
shown in below figure.
X-Shear
• The transformation matrix for X-Shear can be represented as:-
• Xsh = 1 Shx 0
0 1 0
0 0 1
• X' = X + ShX . Y
• Y’ = Y
Y-Shear
• The Y-Shear preserves the X coordinates and changes the Y
coordinates which causes the horizontal lines to transform into lines
which slopes up or down as shown in the following figure.
Y-Shear
• The Y-Shear can be represented in matrix from as −
• Xsh = 1 0 0
Shy 1 0
0 0 1
• Y' = Y + Shy . X
• X’ = X
3D SHEARING