You are on page 1of 104

MODULE 2

TRANSFORMATIO
N OF POINTS &
. I N
K LINES
T U N OT E S
Presented by,
VINEETH.V
Asst. Professor
CCET
Downloaded from Ktunotes.in
CAD- SYLABUS
MODULE-2

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


CO-ORDINATE
E S
TRANSFORMATION . I N
N OT
KTU

Downloaded from Ktunotes.in


CO-ORDINATE
TRANSFORMATION
• It means changing of an image from current
position (state) to a new position (state) by
applying certain rules.
Current position (state) .IN New position
T E S
(state)
KTU NO
• Geometric transformation are the
transformations or changes in size, shape,
location etc are accomplished by altering the
coordinate descriptions of an object.

Downloaded from Ktunotes.in


CO-ORDINATE
TRANSFORMATION
Types of transformations are:
1. 2D Transformations
2. 3D transformations

E S . I N
U N OT
Basic Geometric transformations are:
K T
3. Translation/ Move
4. Scaling
5. Rotation
6. Mirroring/ Reflection/ Flip
7. Shearing

Downloaded from Ktunotes.in


S . I N
2D TRANSFORMATION
T U N OTE
K

Downloaded from Ktunotes.in


2D TRANSFORMATION
• When transformation of coordinates
takesplace on 2D plane or XY plane, it
is called as 2D transformation.
S . I N
T U N OTE
K (x2,y2
)

line

(x1,y1
)

Downloaded from Ktunotes.in


2D TRANSFORMATION

Basic 2D Geometric
transformations are:
E S . I N
1. 2D Translation/
N OMove
T
K T U
2. 2D Scaling
3. 2D Rotation
4. 2D Mirroring/ Reflection/ Flip
5. 2D Shearing

Downloaded from Ktunotes.in


1. 2D Translation/
Move/Shift
• It is the repositioning or shifting an
object along a straight-line path
(translation distances- tx, ty ) from
one coordinate location E S .
to I Nanother
U N O T
KT
without deformation. (x’,y’)

• Also called as shift/move/transaltion.


(tx,ty)

(x,y)

Downloaded from Ktunotes.in


2D Translation/ Move
• We translate a 2D point by adding a
translation distance tx and ty , to the
orginal coordiante position (x,y) to move
the point to a new position
S . I(x’,y’)
N
N OT E
New position ofK x,
T U
x’ = x + tx
New position of y,
y’ = y + ty
Where, tx and ty are translation vector or shift
vector
Downloaded from Ktunotes.in
2D Translation/ Move

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


2D Translations in
Homogenised
coordinates
• Transformation matrices for 2D
translation in 3x3 column
S . I N
matrix: KTUN OT E
 x   1 0 t x   x  x  x  t x
 y   0 1 t  . y 
   y   y  y  t y
 1   0 0 1   1  11
[P’] =[T] +
[P]
Downloaded from Ktunotes.in
2. 2D Scaling
• It alters the size of an object (either
reduced or enlarged size)

S . I N
T U N OTE Sx

y
K
Sy

x f , yf 
x

Downloaded from Ktunotes.in


2D Scaling
• It is transformed by multiplying the current
coordinate values (x,y) of each vertex by
Scaling factors sx & sy to produce the
new transformed coordinates.I(x’,y’)
N
OT E S
K T U N
New position of x,
x’ = x . Sx
New position of y,
y’ = y . Sy

Where, sx & sy are scaling factors


Downloaded from Ktunotes.in
2D Scaling- Scale factor [S]

Scale factor [S] value has only


positive values :
• Value less than 1 (<1)  Reduce
the size of objectOTES.IN
T U N
K than 1 (>1)  Enlarge
• Value greater
the size of object
• Same value (=1)  Uniform
scaling
• Unequal value (≠1)  Differential
scaling
Downloaded from Ktunotes.in
2D Scaling
• In matrix form,

 x   s x 0 0  x N
 y    0 S . I x  x.s x
sy 0
. y 
N OT E
   K T U   y  y.s y
 1   0 0 1  1 

[P’] =[S] .
[P]

Downloaded from Ktunotes.in


3. 2D Rotation
• It is the repositioning of an object
along a circular path in the xy plane.

S . I N
y
T U N OTE y  x, y 
K
   x, y 
yr
x  xr , yr  x
xr

Downloaded from Ktunotes.in


2D Rotation
• To generate a rotation, we specify a
rotation angle θ and the position of
the rotation point (pivot point) about
which the object isTto
E be
S . I N
rotated.
U N O
KT for θ counter
• Positive value
clockwise rotation
• Negative value for θ clockwise
rotation

Downloaded from Ktunotes.in


2D Rotation
From the figure ,
---we have to find the new position (x’
, y’)
S . I N
T U N OTE
K

Downloaded from Ktunotes.in


2D Rotation
Considering a triangle OAP’
Cos (θ + Φ ) = x’ / OP’
x’ = OP’ . Cos (θ + Φ)
E S . I N
=
U N OT
OP’ (Cosθ. CosΦ –
K
Sinθ. SinΦ)
T
Similarly
Sin(θ + Φ ) = y’ / OP’
y’ = OP’ . Sin (θ + Φ)
= OP’ (Sinθ. CosΦ +
Downloaded from Ktunotes.in
2D Rotation
Considering a triangle OAP
CosΦ = x / OP
x = OP . CosΦ
E S . I N
Similarly U N O T
K T
SinΦ = y / OP
y = OP .SinΦ
we know OP = OP’
So, x’ = xCosθ – ySinθ
y’ = xSinθ + yCosθ
Downloaded from Ktunotes.in
2D Rotation
• In matrix form,

S . I N
T U N OTE
K . [P]
[P’] = [R(θ)]
ie…
x’ = xCosθ – ySinθ
y’ = xSinθ + yCosθ
Where, R(θ) = Rotation transformation
operator
Downloaded from Ktunotes.in
4. 2D REFLECTION/
FLIP/MIRRORING

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


5. 2D SHEARING
• Shearing transformation is the
transformation which alters the
shape of an object.
• Deformation of shape E S
of. I N
object
U N OT
T x and y direction
takesplaceKin

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


Various 2D
TRANSFORMATIONs

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


 x   1 0  t x  x
2D
 y    0 1  t y   y , P T  t x , t y  P
Translation
   
 1  0 0  1  1

 x   cos   sin    0  x
 y    sin  cos    0   y , P R    P
2D
   S . I N
Rotation
 1 
T U N 0 OTE0   1  1
K
 x   S x 0  0 x
 y    0 S y   0   y , P S S , S P
2D
Scaling       x y
 1  0 0   1  1

April 2010 31
Downloaded from Ktunotes.in
S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
3D TRANSFORMATION
T U N OTE
K

Downloaded from Ktunotes.in


3D TRANSFORMATION
• When transformation of coordinates
takesplace on 3D plane or XYZ plane,
it is called as 3D transformation.
S . I N
T U N OTE
K (x2,y2,Z2
)

line

(x1,y1,Z1
)

Downloaded from Ktunotes.in


3D TRANSFORMATION

Basic 3D Geometric
transformations are:
E S . I N
1. 3D Translation/
N OMove
T
K T U
2. 3D Scaling
3. 3D Rotation
4. 3D Mirroring/ Reflection/ Flip
5. 3D Shearing

Downloaded from Ktunotes.in


1. 3D Translation
.
•Moving of object in x,y,z direction as translation vector
tx,ty,tz respectively
x  x  t x
y
y  y  t y

S . I N
z  z  t z
T U N OTE
K  x, y, z
 x   1 0 0  t x  x
 x, y , z   y  
    0 1 0  t y  y

 z   0 0 1  t z  z
z x      
 1  0 0 0  1  1

April 2010 36
Downloaded from Ktunotes.in
S . I N
T U N OTE
K

Downloaded from Ktunotes.in


2. 3D Scaling
y y
x  x S x

y  y S y

z   x S z

z x S z
. I N x
T U N OTE
Kmoves it from
Enlarging object also
origin
 x   Sx 0 0  0 x
 y   0 Sy 0  0 y
P         S P
 z   0 0 Sz   0  z
     
 1  0 0 0  1 1

April 2010 38
Downloaded from Ktunotes.in
Scaling
g size of object in x,y,z direction as scaling vector sx,sy,sz respectively

x’=sxx
y’=syy
z’=szz

S . I N
p’=Sp
T U N OTE
K
 sx 0 0 0
 0 sy 0 0
S = S(sx, sy, sz) =  
 0 0 sz 0
 
 0 0 0 1
Angel: Interactive Computer
39 Graphics 3E © Addison-Wesley
Downloaded from Ktunotes.in2002
3. 3D Rotation
• ROTATION at x,y,z direction at rotating angle
about a fixed pivot point.
• Need to specify which axis the rotation is about.
Rotation about z-axis
S . I N
T U
 N
cos 
OTE  sin  0 0
K
 sin  cos 0 0
R z ( )  
 0 0 1 0
 
 0 0 0 1

02/10/09 Lecture 4 40
Downloaded from Ktunotes.in
Rotating About the x-
axis Rx()

 x  O 1 TE
0 S . I N
0 0  x
K  T 
U N   
 y   0 cos θ  sin θ 0   y
 z    
0 sin θ cos θ 0  z
     
 1  0 0 0 1   1
     

02/10/09 Lecture 4 41
Downloaded from Ktunotes.in
S . I N
T U N OTE
K

Downloaded from Ktunotes.in


Rotating About the y-
axis
Ry()

 x   cos S . I
θTE0 sin θ
N 0  x
KT UN  O   
 y  0 1 0 0  y
 z     sin θ 0 cos θ 0 
 
z
     
 1  0 0 0 1   1
    

02/10/09 Lecture 4 43
Downloaded from Ktunotes.in
S . I N
T U N OTE
K

Downloaded from Ktunotes.in


Rotation About the z-
axis
Rz()

S . I N
 x  N cos
O Tθ E sin θ 0 0  x 
K TU     
 y   sin θ cos θ 0 0  y 
 z   0 0 1 0 z   
     
 1  0 0 0 1   1 
  

02/10/09 Lecture 4 45
Downloaded from Ktunotes.in
Rotation in 3D
• For rotation about the x and y axes:

1 0 0 0 E S . I N
cos 0 sin  0
 0 cos U N OT
sin  0
K T  0 1 0 0
R x ( )   , R y ( )  
 0 sin  cos 0   sin  0 cos 0
   
0 0 0 1  0 0 0 1

02/10/09 Lecture 4 46
Downloaded from Ktunotes.in
Rotating About An Arbitrary
Point
• What happens when you apply a
rotation transformation to an object
that is not at the origin?
• Solution: S . I N
T U NOTE
– TranslateKthe center of rotation to the
origin
– Rotate the object
– Translate back to the original location

Downloaded from Ktunotes.in


Rotating About An Arbitrary
y
Point y

x x

S . I N
y
T U N OTE y
K
x x

Downloaded from Ktunotes.in


Rotation about x and y
axes
• Same argument as for rotation about z axis
– For rotation about x axis, x is unchanged
– For rotation about y axis, y is unchanged
1 0 0 0
 0 cos  - sin  0
S . I N
T

U N
R = Rx() =  0 sin  cos  0
OTE

K  
 0 0 0 1 

 cos  0 sin  0
 0 1 0 0
R = Ry() =  
 - sin  0 cos  0
 
0 0 0 1
 Angel: Interactive Computer 
49 Graphics 3E © Addison-Wesley
Downloaded from Ktunotes.in
2002
4. 3D Reflection
• Mirroring of object along x, y or z axis

sx = -1 sy = 1 original

S . I N
T U N OTE
K

sx = -1 sy = -1 sx = 1 sy = -1

Angel: Interactive Computer


50 Graphics 3E © Addison-Wesley
Downloaded from Ktunotes.in2002
3D Reflection

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


5. 3D Shearing
• Shearing transformation is the
transformation which alters the
shape of an object.
• Deformation of shape E S
of. I N
object
U N OT
T x,y and z direction
takesplaceKin

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


Combined
transformation
• It is the transformation of different
types of geometric transformation
like:
1. Translate or move T S
object
E . I N
by 2 units in
T U N O
x,y and zKdirection
2. Scaling it into 2 units in x,y and z
direction
3. Rotating the points at rotating angle.

Downloaded from Ktunotes.in


Combined
transformation
• 2 methods are:
1. Direct method
• Step by step method of combined
transformation S . I N
U
1. [xx ] = [T]. [X]
T N OTE
K
2. [xx ] = [S]. [X]
3. [xx ] = [R(θ)]. [x]

2. Concatenation method

Downloaded from Ktunotes.in


2. Concatenation
transformation
• We can form arbitrary affine transformation
matrices by multiplying together
translation,scaling & rotation matrices
[xx ] = [Tc]. [X]TES.IN
Where, K
Tc= NO
TUconcatenation transformation= [T]. [S].
[R(θ)].

Angel: Interactive Computer


62 Graphics 3E © Addison-Wesley
Downloaded from Ktunotes.in2002
S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


Homogeneous transformation
(w or h)
2D
• It is the conversion of 2x2 matrices
of points P(x,y) to 3x3 matrices of
point P(x,y,1) in 2D E S . I N
U N OT
3D K T
• It is the conversion of 3x3 matrices
of points P(x,y,z) to 4x4 matrices of
point P(x,y,z,1)

Downloaded from Ktunotes.in


2D Translations in
Homogenised
coordinates
• Transformation matrices for 2D
translation in 3x3 column
S . I N
matrix: KTUN OT E
 x   1 0 t x   x  x  x  t x
 y   0 1 t  . y 
   y   y  y  t y
 1   0 0 1   1  11
[P’] =[T] +
[P]
Downloaded from Ktunotes.in
S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


PROJECTIONS
S . I N
T U N OTE
K

Downloaded from Ktunotes.in


PROJECTIONS
• Once the world coordinate
description of the object in a scene
are converted to viewing
coordinates, we can project 3D
object onto 2D view S . I N
TOTEplane.
U N
K project

3D object ------------> 2D view


plane

Downloaded from Ktunotes.in


TYPES OF PROJECTIONS

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


TYPES OF PROJECTIONS

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


PARALLEL PROJECTION VS
PERSPECTIVE PROJECTION
PARALLEL PROJECTION
PERSPECTIVE PROJECTION

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


PARALLEL PROJECTION
ADVANTAGE
• Accurate views of various sides of
object are obtained.
S . I N
T U N OTE
K
DISADVANTAGE
• Does not give a realistic
representation of appearance of 3D
object.

Downloaded from Ktunotes.in


TYPES OF PARALLEL
PROJECTION

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


1. MULTIPLE VIEWS

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


ORTHOGRAPHIC PROJECTION-
Advantage & Application
• Engineering and architectural drawing
commonly employ these orthographic
projections, because length and angles
are accurately depicted
E S . I N
and can
U N OT
measure from
KT drawing itself.

Downloaded from Ktunotes.in


OBLIQUE PROJECTION
• It is obtained by projecting points
along the parallel lines that are not
perpendicular to projection plane.
S . I N
T U N OTE
TYPES: K
1. CAVALIER PROJECTION
2. CABINET PROJECTION

Downloaded from Ktunotes.in


CAVALIER PROJECTION
• It makes 45° with projection plane, α
=45°, the view obtained are called
cavalier projections.
E S .
• All the lines perpendicular I N to
U N OT
projection K T are projected with no
plane
change in length

 Length L1 depends on angle and


z coordinate of point.
Downloaded from Ktunotes.in
S . I N
T U N OTE
K

Downloaded from Ktunotes.in


CABINET PROJECTION
• It makes 63.4° angle with projection plane,
α =63.4°, the view obtained are
called cavalier projections.
• The lines perpendicular
E Sto
. I N
projection plane
are projected N O T
U ½ of the length.
KTwith
ADVANTAGE
• It appears more realistics than cavalier,
because of reduction in length of
perpendiculars.

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


Perspective Projection

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


Types of Perspective
Projection

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


1. ONE POINT PERSPECTIVE
PROJECTION

S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


Perspective Projection
ADVANTAGE:
• Looks realistic
- because size varies inversely with distance
S . I N
T U N OTE
K
DISADVANTAGE:
• We can not judge distance as parallel
projection

Downloaded from Ktunotes.in


S . I N
T U N OTE
K

Downloaded from Ktunotes.in


Perspective
Transformation
• Using 3D homogeneous coordinate
representation, perspective projection
transformation is shown.
S . I N
T U N OTE
K

Downloaded from Ktunotes.in


Reconstruction of 3D
E S . I N
K Tobject
U N OT

Downloaded from Ktunotes.in


Reconstruction of 3D
object
• It is the process of capturing shape
and appearance of real object.
•  If the model is allowed to change its
shape in time, this isE S . I N
referred to as 
U N O T
KT
non-rigid or spatio-temporal
 reconstruction.

Downloaded from Ktunotes.in


Reconstruction of 3D
object
• This process can be accomplished
either by:
– Active method
– Passive methods TES.IN
U N O
KT
1. Active method
• Reconstruct the 3D profile by 
numerical approximation approach
 and build the object in scenario
based on model using Range finders.
Downloaded from Ktunotes.in
Reconstruction of 3D
object
2. Passive method
– Passive methods of 3D reconstruction do
not interfere with the reconstructed object;
– they only use a sensorSto
E . I Nmeasure the
radiance reflected
U N O T
or emitted by the
K T
object's surface to infer its 3D structure
through image understanding

Downloaded from Ktunotes.in


Application of Reconstruction of 3D object

3D reconstruction system finds its application in a variety of


field they are:
• Medicine
• Film industry
• Robotics
• City planning
S . I N
• Gaming
T U N OTE
K
• Virtual environment
• Earth observation
• Archaeology
• Augmented reality
• Reverse engineering
• Animation
• Human computer interaction

Downloaded from Ktunotes.in

You might also like