You are on page 1of 28

L2-1: Introduction to Geometric

Transformations
BITS Pilani Dr. Srinivasa Prakash Regalla
Department of Mechanical Engineering
Hyderabad Campus
Learning OBJECTIVES

 Non-homogeneous and homogeneous representation of


a point in parametric space

 Basics of Geometric Transformations


– Translation
– Scaling
– Reflection
– Rotation
– Concatenated Transformations

BITS Pilani, Hyderabad Campus


Matrix Representation of a Point in E3
Space in Parametric Geometric Modeling
 Geometric Modeling of objects= (Description of geometry + Computerization)
 CAD Geometric Model of an Object = collection of points (=geometry) that are
related by connectivity principle (=topology).
P0=xp0i+yp0j+zp0k Y (zp1-zp0)k
Non-homogenous computational (matrix) form: P1
(yp1-yp0)j
P0
P0=[xp0,yp0,zp0]T; P1=[xp1,yp1,zp1]T
(xp1-xp0)i
Homogeneous computational (matrix) form:
P0 P1
P0=[xp0,yp0,zp0,1]T; P1=[xp1,yp1,zp1,1]T
Similarly other points so on.
O
The constant “1” is called the scaling factor “h”.
MCS X
The scaling factor h=1 for all affine/isometric Z
representations and transformations.
BITS Pilani, Hyderabad Campus
Exercise:

Write the non-homogeneous and homogeneous representation of the a point


located at x=20 mm, y=40 mm, and z=50 mm.
Solution:
Non-homogeneous form:

Homogeneous form:

BITS Pilani, Hyderabad Campus


Matrix Representation of a Straightline in E3
Space in Parametric Geometric Modeling
P0=[xp0,yp0,zp0,1]T ; P1=[xp1,yp1,zp1,1]T
P(u)= P0 +u(P1 - P0), 0u1; here “u” is the parameter
P(u)=[xp0,yp0,zp0,1]T+u([xp1,yp1,zp1,1]T-[xp0,yp0,zp0,1]T), 0u1

Geometric Modeling Entities: Y zL1k


Solids– Topologically three-dimensional: u,v,w L1
P1 yL1j
P0
Surfaces – Topologically two-dimensional: u,v
xL1i
Curves – Topologically one-dimensional: u
P0 P1
Points

MCS X
Z
BITS Pilani, Hyderabad Campus
Exercise:

Find the mid-point and 3/4th distance point on the parametric straight line between
points P0=(5,8,3) and P1=(12,18,15). Use homogeneous form.
Solution:
Y zL1k
P1 yL1j
L1
P0
xL1i

P0 P1

MCS X
Z

BITS Pilani, Hyderabad Campus


Isometric/affine transformation of
geometric models
 Transformation of geometric models implies
a unique relationship between each point on
the original model to one and only one point
on the transformed model:

P*=f(P, transformation parameters) unique

 Geometric transformation means the


coordinate system is fixed and the model is
moved in that same coordinate system from
one location to the other location, by rigid-
body motion

BITS Pilani, Hyderabad Campus


Various affine/isometric transformations

 Rotation

 Translation or panning

 Scaling or zooming

 Mirroring or reflection

BITS Pilani, Hyderabad Campus


Rotational transformation of a point
about MCS Z-axis
 When we rotate about MCS Z-axis, only the X and Y coordinates of the
point change where as z-coordinate value remains the same.
x*  r cos     r cos cos   r sin  sin 
 x cos  y sin  Y P*(x*,y*,z*)
y*  r sin      r sin  cos   r cos sin 
 x sin   y cos r P(x,y,z)
z*  z
θ r
 x * cos  sin  0 0  x  α
 y *  sin  cos 0 0  y 
     
    
z
  *  0 0 1 0  z
  Z X

 1   0   
(out of screen)
0 0 1 1 
P *  [ R] z P BITS Pilani, Hyderabad Campus
Rotational Transformation Matrices for
Rotation about X- and Y- axes of MCS

BITS Pilani, Hyderabad Campus


Exercise:

Find P* resulting from the point P = (5,3,1) mm being rotated by 60° about the
MCS Z-axis.

BITS Pilani, Hyderabad Campus


Translation Transformation

 Every entity of geometric model remains parallel to its initial position


 Slopes and tangent vectors (both magnitude and direction) remain same at
all points on the curve, only the coordinates of points change

 x*  x  xd

P*  P  d   y*  y  y d d
P*
 z*  z  z
 d
P
P  x y z
T
T
X
 same
where P *  x * y * z * 
d  xd y d z d  
T  MCS

BITS Pilani, Hyderabad Campus


Translation Transformation
With the help of Homogeneous Transformation matrix, translation
transformation can be achieved as a “multiplication” of transformation matrix,
rather than “addition”, facilitating the concatenation of transformations
*  
Addition process of translatio n : P  P  d
 x *  x   x d  P*(x*,y*,z*)
     
 y *   y    y d  P(x,y,z)
 z *  z   z 
     d
Use the homogeneous transforma tion matrix
Y
to convert it to a multiplica tion process :
    1 0 0 xd   
 x * x   x X
*     0 1 0 y d  
P   y *  [T ] y    y
 z  0 
0 1 zd  z  Z
 z * 
    0 0 0 1  1 
 
1 1   
BITS Pilani, Hyderabad Campus
Exercise:

A point on the CAD object is at P=[1,1,1]T. Use the homogeneous translation


transformation matrix to obtain the new location P* when P is translated
through d=[2,1,1]T.
Solution: P*(x*,y*,z*)
 P(x,y,z)
P  [1 1 1] ; d  [2 1 1]T
T

Y
    1 0 0 2    
 x * x   1 3
*     0 1 0 1    
P   y *  [T ] y   1  2 X
 z *  z  0 0 1 1  1 2 Z
    0    
0 0 1 1 1 
1  1 
BITS Pilani, Hyderabad Campus
SCALING Transformation
General Scaling about the MCS origin (Non-affine):
 Increase and decrease s x 0 0 0
in size is achieved by 0 
P *  S P  where S   
s y 0 0 ; si  0
scaling. Scaling may 0 0 s z 0
 
be done w. r. t. origin  0 0 0 1 
of MCS or another  x*   s x 0 0 0  x 
 * 
point. y   0 sy 0 0
 y
 
 *   
 Uniform scaling is  
z  0 0 s z 0  z
1    
implemented as    0 0 0 1  1 
“zoom” operation; its  x *  s x x; y *  s y y; z *  s z z
an affine/isometric If S   I   no scaling ;
transformation if there If S   sI   uniform scaling
is no change of shape If s 1  size increases  zoom in
If s 1  size decreases  zoom out

BITS Pilani, Hyderabad Campus


Exercise:

What is the main attribute of uniform scaling transformation:

(A) The proportions in which x, y and z are scaled the same


(B) Each of x, y and z coordinates are linearly scaled with differing proportions
(C) It is same as panning operation
(D) It is a non-isometric transformation

BITS Pilani, Hyderabad Campus


REFLECTION or Mirroring
Transformation
 Reflection is useful (used for mirroring in CREO):
- in building parts of symmetry
P *  M P 
- only half the part needs to be built  m11 0 0 0
 0 m22 0 0
- rest is built by reflection M    
 Reflection may be done generally through 0 0 m33 0
 
(a) either a plane  0 0 0 1
(b) or a line  1 0 0 0
(c) or a point 0 1 0 0
  
 Particular cases of these are: 0 0 1 0
1) Through one of the principal planes (X=0, Y=0  
0 0 0 1
or Z=0)
2) Through one of the principal axes (X, Y or Z)
3) Through the origin of MCS
BITS Pilani, Hyderabad Campus
Mirroring Transformation
Y
Y Y

X
X X
Z
Z Z

Reflection through Reflection through Reflection through


an MCS plane an MCS axis the MCS origin

BITS Pilani, Hyderabad Campus


Mirroring Transformation
Y
Y Y

X
X X
Z
Z Z
Through the origin of MCS:
1)Through a principal plane: It is Through a principal axis: equivalent to reflecting through
equivalent to negating the equivalent to reflecting through the three principal planes
corresponding coordinate of each the two principal planes intersecting at the origin:
point on the entity. intersecting at that axis. m11= m22=m33= -1
P*= - P
X=0 plane => m11= -1, m22=m33=1 X - axis => m11= 1, m22=m33=-1 Magnitudes of the tangent
Y=0 plane => m11=m33=1; m22= -1 Y - axis => m11=m33=-1; m22= 1 vectors remain same,
Z=0 plane => m11=m22=1; m33= -1 Z - axis => m11=m22=-11; m33= 1 directions are reversed.

BITS Pilani, Hyderabad Campus


CONCATENATED TRANSFORMATIONS
 Concatenated means connected.
 When we conduct a series of transformations on a point
in an order, the homogeneous representation of the
point as well as the transformation matrix enables easier
application of concatenated transformation by simple
matrix multiplication
 For example a point [P] is to be transformed in that
order, first translation along vector d with [T]d as [T] = [M]y [T]s [R]x [T]d
transformation matrix, then rotated by X-axis for which it Using which we can obain
the final location of the point
is [R]x, then scaled with “s” as scaling factor for which it
as:
is [T]s and finally to be mirrored about Y-axis for which it [P]* = [T][P]
is [M]y, then the concatenated transformation matrix
can be obtained as:
BITS Pilani, Hyderabad Campus
Concatenated Transformation Matrix:

BITS Pilani, Hyderabad Campus


Exercise:

What is the main advantage of using homogeneous transformation matrices?

(A) Computational time is reduced


(B) Concatenated transformation is possible
(C) Translation can be done using matrix multiplication
(D) Translation can be done using matrix addition

BITS Pilani, Hyderabad Campus


BITS Pilani
Hyderabad Campus

Mapping
Mapping
 Mapping involves the object being fixed in space and we seek the coordinates of
its points with respect to a different coordinate system
 Useful for transferring feature data from WCS to MCS

Translational mapping Rotational mapping


BITS Pilani, Hyderabad Campus
FORMAL DEFINITION AND SETUP OF
WCS
STEP 1: Select three non-collinear points,
P1, P2 and P3
P3
STEP 2: The first of these, P1, forms the
origin of WCS P2

STEP 3: The first and the second, P1 and P1


P2, define the XW-axis.
STEP 4: The third point, P3, is used to
define the XWYW plane of the WCS.
STEP 5: The ZW axis is determined from
the cross product of the two unit
vectors, n1 and n2, where n1: P1→ P2 ZW=(P2 - P1)(P3 - P1)
and n2: P1 → P3

BITS Pilani, Hyderabad Campus


Mapping of feature data from WCS to
MCS
 Once a WCS is defined, user coordinate
data input is referred to this WCS
 Meanwhile, the software calculates the
homogeneous mapping matrix between
WCS and MCS for storing data.
P = [T] PW
P = Position vector of a point relative to
MCS t11 t12 t13 t14 
t t 24   MW R 
PW = Position vector of a point relative to
 t t 23 M
PW , orig 
WCS [T ]  21 22
 
t31 t32 t33 t34   0 0 0 1 
[T] = The homogeneous mapping matrix  
0 0 0 1

BITS Pilani, Hyderabad Campus


Finding the elements of the Mapping
matrix
Cosine Cosine Cosine
of Angle of angle of angle
of X with of X with of X with
Xw Yw Zw

Cosine
of Angle
of Y with
1 0 0 a  1  a  1
Xw 0    
0  1 b  1 b  0
[C ]     
0 1 0 c  0  c  1 
Cosine
of angle Cosine
of Y with    
0 0 1  1  1 
of angle
Yw of Y with 0
Zw BITS Pilani, Hyderabad Campus
THANK YOU!
ANY QUESTIONS!

You might also like