geometric tranformations presented by -lakshmi sahithi

36
GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

Upload: arnold-harris

Post on 17-Jan-2016

224 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

GEOMETRIC TRANFORMATIONSPresented By-Lakshmi Sahithi

Page 2: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

GEOMETRIC TRANSFORMATIONS

Geometric Transformation

• The object itself is moved relative to a stationary coordinate system or background.

• With respect to some 2-D coordinate system, an object O is considered as a set of points.

O = { P(x,y)}• If the Object O moves to a new position, the new object

O’ is considered: O’ = { P’(x’,y’)}

Page 3: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

GEOMETRIC TRANSFORMATIONS

• There are two types of Transformations:• 2D Transformations• 3D Transformations

Page 4: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D-Transformations

Types of 2D Transformations:

• 2D Translations• 2D Scaling • 2D Rotation• 2D Reflection• 2D Shear

Page 5: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D Scaling

• Scaling • Linear transformation that enlarges (increases)

or shrinks (diminishes) objects by a scale factor that is the same in all directions. The result of uniform scaling is similar (in the geometric sense) to the original.

Page 6: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D Translation

• 2D Translations• Moving an object is called a translation. We

translate an object by translating each vertex in the object

• It translates the point P to P’ using the dx and dy.

• dx and dy refers to the distance between x and y co ordinates of P and P’.

Page 7: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D Rotation

• Rotation is moving a point in space in non-linear manner.

• It involves moving the point from one position on a sphere whose center is at origin to another position on sphere.

• Rotating a point requires:• The coordinates for the point• The rotation angles

Page 8: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D Reflection

• 2D Reflection • is a transformation that produces a mirror

image of an object. It is obtained by rotating the object by 180 deg about the reflection axis

Page 9: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D Shear

• Shear is a transformation that distorts the shape of an object such that the transformed shape appears as if the object were composed of internal layers that had been caused to slide over each other

• Two common shearing transformations are those that shift coordinate x values and those that shift y values

Page 10: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D Translations

Page 11: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

11

P

• The new position P’ for the point P is calculated as below.

p’ = p+ T where

and x’ = x + dx y’ = y + dy

Here dx and dy are the change’s in distance of x and y co ordinates of axis.

2D Translation

dx = 2dy = 3

Y

X 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

dy

dxw

y

xT

y

xp ,

'

',

2

2

5

4

(Note: Points are at object’slocal coordinate system origin)

Page 12: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D Scaling

• Let P be P(x,y)• Now we scale the point P(x,y) to point P(x’,y’) by a factor

sx and sy along x and y axis respectively• So we have to find out P’(x’,y’) where S=(sx,sy).

PSP

y

x

s

s

y

x

y

x

'

0

0

'

'

PP’

Page 13: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

'

'',

y

xP

y

xP

y

x

s

sS

0

0

ysy

xsx

y

x

'

'

Y

X 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

2

3

y

x

s

s

2D Scaling

1

2

1

3

2

6

2

9

Page 14: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D Rotation

)cos('

)cos('

sin

cos

)(

),(

ry

rx

ry

rx

R

yxP

x

y

,r rx y

,x y

,x y

Page 15: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

PRP

y

x

y

x

yxy

yxx

rry

rrx

'

cossin

sincos

'

'

cossin'

sincos'

cossinsincos'

sinsincoscos'

Page 16: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D Reflection

-1 0 0

0 -1 0

0 0 1

1’

2’

3’

3

2

1

Original position

Reflected position

Reflection of an object relative to an axis perpendicular to the xy plane and passing through the coordinate origin

X-axis

Y-axis

Origin O (0,0)

The above reflection matrix is the rotation matrix with angle=180 degree.

This can be generalized to any reflection point in the xy plane. This reflection is the same as a 180 degree rotation in the xy plane using the reflection point as the pivot point.

Page 17: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

Reflection of an object w.r.t the straight line y=x

0 1 0

1 0 0

0 0 1

1’

3’

2’

3

2 1

Original position

Reflected position

X-axis

Y-axis

Origin O (0,0)

Page 18: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

Reflection of an object w.r.t the straight line y=-x

0 -1 0

-1 0 0

0 0 1

1’

3’

2’

3

X-axis

1Original position

Reflected position

2

Y-axis

Origin O (0,0)

Line Y = - X

Page 19: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

2D Shears

Original Data y Shear x Shear

1 0 0 1 shx 0

shy 1 0 0 1 0

0 0 1 0 0 1

Page 20: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

An X- direction Shear

(0,1) (1,1)

(1,0)(0,0) (0,0) (1,0)

(2,1) (3,1)

For example, Shx=2

Page 21: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

An Y- direction Shear

(0,1) (1,1)

(1,0)(0,0) (0,0)

(0,1)

(1,3)

(1,2)

For example, Shy=2

X X

Y Y

Page 22: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

Transformations

• Let P be the original point , then the transformed point is given by the following

• Translation P=T + P• Scale P=S P• Rotation P=R P

Page 23: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

3D Transformations

•Translations•Scaling•Rotation•Shear •Reflection

Page 24: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

3D Translation

• 3D Translations are very similar to that of 2D Translations

• Let us take a three dimensional coordinate system and consider a point P(x,y,z) in the system.

Page 25: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

3D Translation

• Let P’(x’,y’,z’) be the point after translation• X’=x+tx

• Y’=y+ty

• Z’=z+tz

• Where tx, ty and tz represent the distance between x, y and z co-ordinate’s from original point P.

Page 26: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

3D Translation

• The diagram below explains it clearly,

Page 27: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

3D Scaling

x

y

z x

y

z

x

y

z

x x S

y y S

z x S

When we enlarge object the position of the object changes from origin

0 0 0

0 0 0

0 0 0

1 0 0 0 1 1

x

y

z

x S x

y S y

z S z

P S P

Page 28: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

, ,f f fx y z

x

y

z

Scaling with respect to a fixed point (not necessarily of object)

, ,f f fx y z

x

y

z , ,f f fx y z

x

y

z

, ,f f fx y z

x

y

z

1

0 0 1

0 0 1

0 0 1

0 0 0 1

x x f

y y f

z z f

S S x

S S y

S S z

T S T

Page 29: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

3D Rotation

z

x

y

3D rotation can take place about each axisi.e. It can rotate about x-axis, y-axis, and z-axis

z

x

y z

x

y

Page 30: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

3D Rotation

In 2-D, a rotation is define by an angle θ & a center of rotation P. Whereas in 3-D rotations we need the an angle of rotation & an axis of rotation.

• Rotation about the z axis: R θ,K x’ = x cosθ – y sinθ

y’ = x sinθ – y cosθ z’ = z

Page 31: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

3D Rotation

Rotation about the y axis: R θ,J x’ = x cosθ + z sinθ

y’ = y z’ = - x sinθ + z cosθRotation about the x axis: R θ,I x’ = x

y’ = y cosθ – z sinθ z’ = y sinθ + z cosθ

Page 32: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

& the rotation matrix corresponding is cos θ -sin θ 0 R θ,K = sin θ cos θ 0

0 0 1

cos θ 0 sin θ R θ,J = 0 1 0

-sin θ 0 cos θ

1 0 0 R θ,I = 0 cos θ -sin θ 0 sin θ cos θ

Page 33: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

3D Reflections• The matrix expression for the reflection transformation of a

position P = (x, y, z) relative to x-y plane is given below:

• Transformation matrices for inverting x and y values are defined similarly, as reflections relative to yz plane and xz plane, respectively.

Page 34: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

3D Shears

• The matrix equation for the shearing transformation of a position P = (x, y, z), to produce z-axis shear, is shown below:

Page 35: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

Shears

• Parameters a and b can be assigned any real values. The effect of this transformation is to alter x- and y- coordinate values by an amount that is proportional to the z value, while leaving the z coordinate unchanged.

• Shearing transformations for the x axis and y axis are defined similarly.

Page 36: GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi

Thank you!!