Docsity

2D Geometric Transformations-Computer Graphics-Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download 2D Geometric Transformations-Computer Graphics-Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

2D GeometricTransformations

Contents ^

Definition & Motivation

^

2D Geometric Transformation ^

Translation ^

Rotation ^

Scaling ^

Matrix Representation

^

Homogeneous Coordinates

^

Matrix Composition

^

Composite Transformations ^

Pivot-Point Rotation ^

General Fixed-Point Scaling ^

Reflection and Shearing ^

Transformations Between Coordinate Systems

Example: 2D GeometricTransformation

ModelingCoordinates

World Coordinates

Example: 2D Scaling

ModelingCoordinates

World Coordinates

Scale(0.3, 0.3)

Example: 2D Translation

ModelingCoordinates

Scale(0.3, 0.3)Rotate(-90)Translate(5, 3)

World Coordinates

Example: 2D GeometricTransformation

ModelingCoordinates

World Coordinates

Again?

Basic 2D Transformations ^

Translation   ^

(t^ ,tx

) is referred to as translation vectory

^

Scale  

^

Rotation  

^

Shear  

tx x x^

ty y y^

sx x x^

sy y y^

sin

θ y- cos

θ

x x^

cos

θ y sin

θ y y^

y hx x x^

x hy y y^

Basic 2D Transformations ^

Rotation involves a rotation angle androtation point ^

Rotation angle: specify the degree of rotation

^

Rotation point: also referred to as pivot pointabout which rotations occur

^

Rotation axis: It is perpendicular to the xy planeand passes through the pivot point

ty ) cos sy) (y sin sx) ((x y

tx ) sin sy) (y cos sx) ((x x

     



     



Basic 2D Transformations ^

Translation  

^

Scale  

^

Rotation  

^

Shear  

tx x x^

ty y y^

sx x x^

sy y y^

sin

θ y- cos

θ

x x^

cos

θ y sin

θ y y^

y hx x x^

x hy y y^

Basic 2D Transformations ^

Translation  

^

Scale  

^

Rotation  

^

Shear  

tx x x^

ty y y^

sx x x^

sy y y^

sin

θ y- cos

θ

x x^

cos

θ y sin

θ y y^

y hx x x^

x hy y y^

sy

y

sx x x

 

 ^ y

Basic 2D Transformations ^

Translation  

^

Scale  

^

Rotation  

^

Shear  

tx x x^

ty y y^

sx x x^

sy y y^

sin

θ y- cos

θ

x x^

cos

θ y sin

θ y y^

y hx x x^

x hy y y^

ty ) cos sy) (y sin sx) ((x y

tx ) sin sy) (y cos sx) ((x x

     



     



Shear  Changes shape of the object along x and y-axis  A shear parallel to the

x^

axis has

x ' =

x^

+^ ky

and

y ' =

y

^

A shear parallel to the

y^

axis has

x ' =

x^

and

y ' =

y^

+^ kx

Matrix Representation ^

Many graphics applications require asequence of operations ^

An animation may require translation as wellas rotation ^

Matrix transformations may be represented inthe form

Matrix Representation ^

Represent a 2D Transformation by aMatrix ^

Apply the Transformation to a Point

     

         

 

x^ y d c

b a

x y

dy cx y

by

ax x





  

  

d c

b a

Transformation

Matrix

Point