Unit 3.2 3D CGMA
Unit 3.2 3D CGMA
In Computer graphics,
Transformation is a process of modifying
and re-positioning the existing graphics.
3D Transformations take place in a
three dimensional plane.
3D Transformations are important and
a bit more complex than 2D
Transformations.
Transformations are helpful in
changing the position, size, orientation,
shape etc of the object.
Transformation Techniques
Translation
Rotation
Scaling
Reflection
Shear
1. 3D Translation in Computer
Graphics
In Computer graphics,
3D Translation is a process of moving an
object from one position to another in a
three dimensional plane.
Consider a point object O has to be moved
from one position to another in a 3D
plane.
Let-
Initial coordinates of the object O =
(Xold, Yold, Zold)
New coordinates of the object O after
translation = (Xnew, Ynew, Zold)
Translation vector or Shift vector = (Tx,
Ty, Tz)
Given a Translation vector (Tx, Ty, Tz)-
Tx defines the distance the
Xold coordinate has to be moved.
Ty defines the distance the
Yold coordinate has to be moved.
Tz defines the distance the
Zold coordinate has to be moved.
Let-
Initial coordinates of the object O =
(Xold, Yold, Zold)
Initial angle of the object O with
respect to origin = Φ
Rotation angle = θ
New coordinates of the object O after
rotation = (Xnew, Ynew, Znew)
Solution-
Given-
Old coordinates = (Xold, Yold, Zold) = (1, 2,
3)
Rotation angle = θ = 90º
For X-Axis Rotation-
Let-
Initial coordinates of the object O =
(Xold, Yold, Zold)
Scaling factor for X-axis = Sx
Scaling factor for Y-axis = Sy
Scaling factor for Z-axis = Sz
New coordinates of the object O after
scaling = (Xnew, Ynew, Znew)
Given-
Old coordinates of the object = A (0,
3, 3), B(3, 3, 6), C(3, 0, 1), D(0, 0, 0)
Scaling factor along X axis = 2
Scaling factor along Y axis = 3
Scaling factor along Z axis = 3
Let-
Initial coordinates of the object O =
(Xold, Yold, Zold)
New coordinates of the reflected
object O after reflection = (Xnew,
Ynew,Znew)
In 3 dimensions, there are 3 possible
types of reflection-
Given-
Old corner coordinates of the triangle
= A (3, 4, 1), B(6, 4, 2), C(5, 6, 3)
Reflection has to be taken on the XY
plane
Let-
Initial coordinates of the object O =
(Xold, Yold, Zold)
Shearing parameter towards X
direction = Shx
Shearing parameter towards Y
direction = Shy
Shearing parameter towards Z
direction = Shz
New coordinates of the object O after
shearing = (Xnew, Ynew, Znew)
Shearing in X Axis-
Given-
Old corner coordinates of the triangle
= A (0, 0, 0), B(1, 1, 2), C(1, 1, 3)
Shearing parameter towards X
direction (Shx) = 2
Shearing parameter towards Y
direction (Shy) = 2
Shearing parameter towards Y
direction (Shz) = 3
Shearing in X Axis-
Shearing in Z Axis-