You are on page 1of 24

Topics to be Covered

Transformation


Matrix Representations and Homogenous Coordinates
Basic Transformations



Geometrical
Coordinate

Translation
Rotation
Scaling
Reflection
Shearing

Composite Transformations

Copyright @ www.bcanotes.com

Transformation

Simulated spatial manipulation is referred as
Transformation
Two types
 Geometric

 Coordinate

y) . ty) is called a translation vector or shift vector P’ (x’. y’) where x’ = x + tx y’ = y + ty tx and ty is the displacement in x and y respectively.  Rigid body transformation that moves object without deformation  Initial Position point P (x.y’) P(x. y)  The new point P’ (x’.Translation Displacement of an object in a given distance and direction from its original position.  The translation pair (tx.

TRANSLATION  Matrix representation  x P   y  x' P'     y ' tx  T   ty  .

we specify  Rotation angle θ  Pivot point ( xr .Rotation   Rotation is applied to an object by repositioning it along a circular path in the xy plane. . To generate a rotation. yr)   Positive values of θ for counterclockwise rotation Negative values of θ for clockwise rotation.

2-D Rotation (x’. y)  Ф . y’) (x.

y sin() y’ = x sin() + y cos() .2-D Rotation x = r cos (f) y = r sin (f) x’ = r cos (f + ) y’ = r sin (f + ) Trig Identity… x’ = r cos(f) cos() – r sin(f) sin() y’ = r sin(f) sin() + r cos(f) cos() Substitute… x’ = x cos() .

2-D Rotation x’ = x cos() .bcanotes.y sin() y’ = x sin() + y cos() Matrix representation P'  R  P cos  R  sin   sin    cos   Copyright @ www.com .

Operation can be carried out by multiplying each of its components by a scalar Uniform scaling means this scalar is the same for all components: 2 .Scaling    Scaling alters the size of an object .

Scaling  Non-uniform scaling: different scalars per component: X  2.5 . Y  0.

Scaling x’ = x* sx y’ = y * sy In matrix form:  x'  sx 0   x   y '   0 sy  y       .

providing that we also expand the matrix representations for coordinate positions. .Homogenous Coordinate System  Allows us to express all transformation equations as matrix multiplications .

Reflection along x axis Reflection along y axis Reflection relative to an axis perpendicular to the xy plane and passing through the coordinate origin Reflection of an object relative to an axis perpendicular to the xy plane and passing through point P Reflection of an object with respect to the line y=x . 5. 4.Reflection   A reflection is a transformation that produces a mirror image of an object Generated relative to an axis of reflection 1. 2. 3.

Reflection About x-Axis y P1 P2 Original Image P3 x P2’ P3’ Reflected Image P1’ .

Reflection About x-Axis  Reflection about x-axis 1 0 0   M  0  1 0  0 0 1 Copyright @ www.com .bcanotes.

Reflection About y-axis Original Image Reflected Image x y .

com .Reflection About y-axis  Reflection about y-axis   1 0 0   M   0 1 0  0 0 1 Copyright @ www.bcanotes.

Reflection relative to an axis perpendicular to the xy plane and passing through the coordinate origin Reflected Image x Original Image y .

com .bcanotes.Reflection relative to an axis perpendicular to the xy plane and passing through the coordinate origin  Reflection about the origin point   1 0 0   M   0  1 0  0 0 1 Copyright @ www.

Reflection of an object with respect to the line y=x y Original Image Reflected Image x .

Reflection of an object with respect to the line y=x  Reflection about with respect to line y=x 0 1 0    M  1 0 0 0 0 1 Copyright @ www.bcanotes.com .

Shearing  A transformation that distorts the shape of an object such that the transformed object appears as if the object were composed of internal layers that had been caused to slide over each other. .

Shearing  Shear relative to the x-axis 1 shx 0 0 1 0    0 0 1 • Shear relative to the y-axis 1 shy 0 0 1 0    0 0 1 .

composite transformation matrix could be setup by the matrix product of the individual transformations Also referred as Concatenation or Composition of Matrices .Composite Transformations   For a sequence of transformations .