0% found this document useful (0 votes)
3 views10 pages

Cad Module IV

Uploaded by

jhaa50452
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views10 pages

Cad Module IV

Uploaded by

jhaa50452
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Computer Aided Design

Module-IV
Geometric transformations, models &
projections
Introduction
➢In computer graphics, drawings are created by a series of primitives which are
represented by the co-ordinates of their end points.

➢Certain changes in these drawings can be made by performing some mathematical


operations on these co-ordinates.

➢The basic transformations are scaling, translation and rotation that provides a means by
which an image can be enlarged in size, or reduced, moved, or rotated, respectively.

➢These changes are brought about by changing the co-ordinates of the picture to a new set
of values depending upon the requirements.

➢Transformations can be carried out either in 2-dimensions or in 3-dimensions.

➢The transformations convert the geometry from one coordinate system to another.
Translation
➢When an object is translated by a, b, and c in the x, y, and z
directions, respectively, from its initial position at which its
model coordinate system coincides with the world
coordinate system (see Fig. 1), the world coordinates of a
point on the object at the new position, (Xw, Yw, Zw) are
obtained as follows:
Xw = Xm + a; Yw = Ym + b; Zw = Zm + c (1)
Fig. 1 Translation of an object
➢In Eq. (1), Xm, Ym and Zm also are the model coordinates of the same point.
➢Equation (1) can be expressed in the following form, using matrix operations:

𝑋𝑤 1 0 0 𝑎 𝑋𝑚
𝑌𝑤 0 1 0 𝑏 𝑌𝑚
= (2)
𝑍𝑤 0 0 1 𝑐 𝑍𝑚
1 0 0 0 1 1
➢This is normally the operation used in the CAD systems as the MOVE command.
➢The matrix used to transform the homogeneous coordinates is called the homogeneous
transformation matrix.
➢Therefore, the transformation matrix on the right-hand side of Equation (2), is a
homogeneous transformation matrix for a translation.

For 2D translation, Eq. 2 can be expressed as:

𝑋𝑤 1 0 𝑎 𝑋𝑚
𝑌𝑤 = 0 1 𝑏 𝑌𝑚 (3)
1 0 0 1 1
Rotation
➢Suppose that an object is rotated by θ about the x axis of
the world coordinate system together with its model
coordinate system (which again coincides the world
coordinate system at its initial position, as illustrated in
Fig. 2).
➢The world coordinates of a point on the object at the new
position, (Xw, Yw, Zw), can be obtained from its original
coordinates, (Xm, Ym, Zm), as follows.
➢Here, (Xm, Ym, Zm) are the coordinates of the point with Fig. 2 Rotation about the x-axis
respect to the model coordinate system, and thus they are
equal to its world coordinates before rotation.

The relation between (Xw, Yw, Zw) and (Xm, Ym, Zm) becomes clear when Fig. 2 is projected
onto the y-z plane, as shown in Fig. 3.

From Fig. 3, the following equations can easily be obtained:


𝑋𝑤 = 𝑋𝑚 (4)
𝑌𝑤 = 𝑙𝐶𝑜𝑠 𝜃 + 𝛼 = 𝑙(𝐶𝑜𝑠𝜃 𝐶𝑜𝑠𝛼 − 𝑆𝑖𝑛𝜃 𝑆𝑖𝑛𝛼)
= 𝑙𝐶𝑜𝑠𝛼 𝐶𝑜𝑠𝜃 − 𝑙𝑆𝑖𝑛𝛼 𝑆𝑖𝑛𝜃
= 𝑌𝑚 𝐶𝑜𝑠𝜃 − 𝑍𝑚 𝑆𝑖𝑛𝜃 (5)
𝑍𝑤 = 𝑙𝑆𝑖𝑛 𝜃 + 𝛼 = 𝑙(𝑆𝑖𝑛𝜃 𝐶𝑜𝑠𝛼 + 𝐶𝑜𝑠𝜃 𝑆𝑖𝑛𝛼)
= 𝑙𝐶𝑜𝑠𝛼 𝑆𝑖𝑛𝜃 + 𝑙𝑆𝑖𝑛𝛼 𝐶𝑜𝑠𝜃
= 𝑌𝑚 𝑆𝑖𝑛𝜃 + 𝑍𝑚 𝐶𝑜𝑠𝜃 (6) Fig. 3 Projection on to the y-z plane

Equations (4), (5), and (6) can be expressed in matrix form as:
𝑋𝑤 1 0 0 0 𝑋𝑚
𝑌𝑤 0 𝐶𝑜𝑠𝜃 −𝑆𝑖𝑛𝜃 0 𝑌𝑚
= (7)
𝑍𝑤 0 𝑆𝑖𝑛𝜃 𝐶𝑜𝑠𝜃 0 𝑍𝑚
1 0 0 0 1 1
The matrix on the right-hand side of Eq. (7) is a homogeneous transformation matrix for
the rotation about the x-axis and thus is denoted Rot(x,θ).
The homogeneous transformation matrix for the rotation about the y- or z-axis can be
derived similarly and expressed as:
𝐶𝑜𝑠𝜃 0 𝑆𝑖𝑛𝜃 0
0 1 0 0
𝑅𝑜𝑡(𝑦, 𝜃) = (8)
−𝑆𝑖𝑛𝜃 0 𝐶𝑜𝑠𝜃 0
0 0 0 1
𝐶𝑜𝑠𝜃 −𝑆𝑖𝑛𝜃 0 0
𝑆𝑖𝑛𝜃 𝐶𝑜𝑠𝜃 0 0
𝑅𝑜𝑡(𝑧, 𝜃) = (9)
0 0 1 0
0 0 0 1
➢We have considered the transformation matrices associated with the rotations about one
of the world coordinate axes.
➢We can then infer that the rotation about an any arbitrarily oblique axis is achieved by a
combination of the rotations about the x-, y-, and z-axes.
➢Thus, the transformation matrix for an arbitrary axis is obtained by combining the
matrices in Eqs. (7)-(9).
Scaling
Scaling is the transformation applied to change the scale of an entity.
As shown in Fig. 4, this alters the size of the entity by the scaling
factor applied.
For example, in the figure, to achieve the scaling, the original
coordinates are multiplied uniformly by the scaling factor (in 3D).

X’ = Sx‧X; Y’ = Sy‧Y; Z’ = Sz‧Z (10) Fig. 4 Scaling of an object (2D)

➢This equation can also be represented in the matrix form as follows:

𝑋′ 𝑆𝑥 0 0 0 𝑋
𝑌′ = 0 𝑆𝑦 0 0 𝑌
(11)
𝑍′ 0 0 𝑆𝑧 0 𝑍
1 0 0 0 1 1
Reflection

➢Reflection (or mirror) transformation is useful in constructing symmetric models.


➢For example, if a model is symmetric with respect to a plane, then only half of its geometry is
created which can be copied by reflection to generate the full model.
➢The transformation required in this case is that the axes of coordinates will get negated
depending upon the reflection required.
➢In the last plot in Fig. 5, the new P* = [X*, Y*] = [X, –Y]

Fig. 5 Reflection
Here, –1 in the first position refers to the reflection about the Y-axis where all the X-
coordinate values get negated. When the second term becomes the reflection, it will be about
the X-axis with all Y-coordinate values getting reversed. Both the values are –1 for reflection
about X and Y-axes.

You might also like