Professional Documents
Culture Documents
EMG 2504: CAD/CAM: Graphical Elements and Transformations
EMG 2504: CAD/CAM: Graphical Elements and Transformations
EMG 2504: CAD/CAM: Graphical Elements and Transformations
James K. Kimotho
SoMMME
Department of Mechanical Engineering
Straight Lines
Straight Lines
The value of 𝑝 ranges between 0 and 1.
– 𝑝 = 0, 𝑡ℎ𝑒𝑛 𝑥 = 𝑥1 and 𝑦 = 𝑦1
– 𝑝 < 0, then the generalized point lies on the opposite side of
(𝑥1 , 𝑦1 ) from (𝑥2 , 𝑦2 )
– 𝑝 = 1, then 𝑥 = 𝑥2 and 𝑦 = 𝑦2
– 𝑝 > 1, then the generalized point lies on the opposite side of
(𝑥2 , 𝑦2 ) from (𝑥1 , 𝑦1 )
• This concept is useful when extending lines.
When calculating which pixels are to be lit, the values of ∆𝑥
and ∆𝑦 can be calculated by varying ratio 𝑝 in increments of
∆𝑝.
Circle
Consider a circle of radius R in 2D plane centered at a point
with coordinates (𝑥1 , 𝑦1 )
Arc
An arc is fully described if its center, its radius and the angles
corresponding to the two end points are specified
Graphical Transformations
Graphical Transformations
Translation
Transformation
Matrix, 𝑇
Scaling
In matrix form:
Rotation
Concatenation of Transformations
To combine all 3 transformations into one matrix, a
homogenous transformation is used.
A homogenous transformation matrix is a 4×4 matrix formed
by introducing a unit coordinate.
A point is represented by a 4D vector as:
Concatenation of Transformations
Graphical Transformations
Example
– Point 𝐴 = 1 3 1 is translated by 𝑇𝑟 = 1 1 1 , rotated about
X-axis, 90𝑜 and then rotated about Y-axis 45𝑜 . What is the A' in
the coordinate frame?
Thank You
for
Your Kind Attention!
Dr.-Ing. James Kuria Kimotho Department of Mechanical Engineering
jkuria@eng.jkuat.ac.ke JKUAT
P.O. Box 62000-00200
Tel: Nairobi