TwoDimensional Geometric Transformations A two dimensional transformation is

  • Slides: 23
Download presentation
Two-Dimensional Geometric Transformations A two dimensional transformation is any operation on a point in

Two-Dimensional Geometric Transformations A two dimensional transformation is any operation on a point in space (x, y) that maps that point's coordinates into a new set of coordinates (x’, y’). Instead of applying a transformation to every point in every line that makes up an object, the transformation is applied only to the vertices of the object and then new lines are drawn between the resulting endpoints.

Two-Dimensional Geometric Transformations • Basic Transformations • • • Translation Rotation Scaling • Composite

Two-Dimensional Geometric Transformations • Basic Transformations • • • Translation Rotation Scaling • Composite Transformations • Other transformations • • Reflection Shear Transformation include change in size, shape & orientation

Translation • Translation transformation Translation vector or shift vector T = (tx, ty) Rigid-body

Translation • Translation transformation Translation vector or shift vector T = (tx, ty) Rigid-body transformation • Moves objects without deformation y y • •

Translation matrix Matrix Representation Row vector representation P = (x, y) P’= (x’, y’)

Translation matrix Matrix Representation Row vector representation P = (x, y) P’= (x’, y’) T = (tx ty) P’ = P + T P = (x, y) x ‘ = x + tx y’ = y + ty

Rotation Repositioning along a circular path in the xy plane (xr, yr) is the

Rotation Repositioning along a circular path in the xy plane (xr, yr) is the rotation point ө is the rotation angle

Rotation transformation x’=rcos(φ+θ)= rcos φ cos θ -rsin φ sin θ y’=rsin(φ + θ)=

Rotation transformation x’=rcos(φ+θ)= rcos φ cos θ -rsin φ sin θ y’=rsin(φ + θ)= rcos φ sin θ +rsin φ cos θ x’ = x cos ө - y sin ө y’ = x sin ө + y Cos ө P’= R· P x=rcos φ y=rsin φ

Rotation about arbitrary pivot point position x’ = xr + (x - xr) cosө

Rotation about arbitrary pivot point position x’ = xr + (x - xr) cosө - (y – yr) sin ө y’ = yr + (x - xr) sin ө - (y – yr) cos ө

General Pivot-Point Rotation • Rotations about any selected pivot point (xr, yr) • Translate-rotate-translate

General Pivot-Point Rotation • Rotations about any selected pivot point (xr, yr) • Translate-rotate-translate

General Pivot Point Rotation

General Pivot Point Rotation

To rotate about P 1 (x 1, y 1), the following sequence of the

To rotate about P 1 (x 1, y 1), the following sequence of the fundamental transformations are needed: 1. Translate the object by (-x 1, -y 1) 2. Rotate (Ø) 3. Translate the object by (x 1, y 1)

General Pivot-Point Rotation

General Pivot-Point Rotation

Scaling Alters the size of an object Scaling an object is implemented by scaling

Scaling Alters the size of an object Scaling an object is implemented by scaling the X and Y coordinates of each vertex in the object.

Scaling transformation Scaling factors, sx and sy Uniform scaling , if sx = sy

Scaling transformation Scaling factors, sx and sy Uniform scaling , if sx = sy

Matrix Representations and Homogeneous Coordinates- allow all transformations as matrix multiplications • Homogeneous Coordinates

Matrix Representations and Homogeneous Coordinates- allow all transformations as matrix multiplications • Homogeneous Coordinates • Matrix representations • Translation h =1 for 2 D transformations

Matrix Representations Matrix representations Scaling Rotation

Matrix Representations Matrix representations Scaling Rotation

Composite Transformations -sequence of transformations Translations

Composite Transformations -sequence of transformations Translations

Composite Transformations Scaling

Composite Transformations Scaling

Composite Transformations Rotations

Composite Transformations Rotations

General Scaling Directions Scaling factors sx and sy scale objects along the x and

General Scaling Directions Scaling factors sx and sy scale objects along the x and y directions. We scale an object in other directions with scaling factors s 1 and s 2

General Scaling Directions

General Scaling Directions

Concatenation Properties Matrix multiplication is associative. A·B ·C = (A·B )·C = A·(B ·C)

Concatenation Properties Matrix multiplication is associative. A·B ·C = (A·B )·C = A·(B ·C) Transformation products may not be commutative Be careful about the order in which the composite matrix is evaluated. Except for some special cases: Two successive rotations Two successive translations Two successive scaling rotation and uniform scaling

Concatenation Properties Reversing the order A sequence of transformations is performed may affect the

Concatenation Properties Reversing the order A sequence of transformations is performed may affect the transformed position of an object.

Reflection A transformation produces a mirror image of an object. Axis of reflection A

Reflection A transformation produces a mirror image of an object. Axis of reflection A line in the xy plane A line perpendicular to the xy plane The mirror image is obtained by rotating the object 1800 about the reflection axis. Rotation path Axis in xy plane: in a plane perpendicular to the xy plane. Axis perpendicular to xy plane: in the xy plane.