Transformations - Technion – Israel Institute of...

47
Transformations Transformations

Transcript of Transformations - Technion – Israel Institute of...

Page 1: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

TransformationsTransformations

Page 2: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one
Page 3: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Geometric Transformations

� Transformation τ is one-to-one and onto mapping of

Rn to itself (in general)

� Affine transformation – τ (V) = AV+b

A – matrix

b – scalar

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

3

b – scalar

� In CG Geometric Transformations are, for the most

part, affine transformations with geometric meaning

� Note: transformation has meaning only for vectors ⇒for point P, τ (P) is a transformation of vector from the

origin to P

Page 4: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Transformations

� Transforming an object = transforming all its points

� For a polygonal model = transforming its vertices

Is it true for any transformation?

Why is it true for us?

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

4

Page 5: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Applications

� Viewing

� Modeling

� Animation

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

5

� Animation

� Image manipulation

Page 6: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Scaling

� V = (vx,vy) – vector in XY plane

� Scaling operator S with parameters (sx,sy):

( )( ) ( )yyxx

sssvsvVS yx ,

, =

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

6

( ) ( )yyxx svsvVS ,=

Page 7: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Scaling� Matrix form:

( )( ) ( ) ( )yyxx

y

x

yx

sssvsv

s

svvVS yx ,

0

0,

, =

=

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

7

� Independent in x and y

Non uniform scaling is allowed

� What is the meaning of scaling by zero?

Page 8: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Rotation

� Polar form:

W

y

V

x

r

αθ

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

8

� Polar form:

V=(vx,vy)=(r cosα, r sinα)

� Rotating V anti-clockwise by θ to W:

)cossinsincos

,sinsincoscos(

))sin(),cos((

),(

θαθαθαθα

θαθα

rr

rr

rr

yw

xwW

+−=

++=

=

Page 9: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Rotation

� Matrix form:

−=

−=

θθθθ

θθθθ

αα

cossin

sincos

cossin

sincos)sin,cos(

V

rrW

)cossinsincos

,sinsincoscos(

θαθαθαθα

rr

rrW

+−=

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

9

� Rotation operator R with parameter θ at the origin:

−=

θθθθ

θ

cossin

sincosR

Page 10: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Rotation Properties

� Rθ is orthogonal

� R-θ - rotation by -θ is

( ) ( )TRR θθ =−1

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

10

� R - rotation by -θ is

( ) 1

cossin

sincos),()(

−− =

−= θθ

θθθθ

RvvVR yx

Page 11: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Translation

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

11

� Translation operator T with parameters (tx,ty):

� Can you express T in a matrix form?

( )( ) ( )yyxx

tttvtvVT yx ++= ,

,

Page 12: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Translation - Homogeneous

Coordinates� To represent T in matrix form

– introduce homogeneous

coordinates:

� Conversion (projection) from

( ) ( )1,,,, h

y

h

x

h

w

h

y

h

x

h vvvvvV ==

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

12

� Conversion (projection) from

homogeneous space to

Euclidean:

� In homogeneous

coordinates:

(2, 2, 1) = (4, 4, 2) = (1, 1, 0.5)

==

h

w

h

y

h

w

h

xyx

v

v

v

vvvV ,),(

Page 13: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Translation

� Using homogeneous coordinates, the translation

operator may be expressed as:

001

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

13

)1,,(

1

010

001

)1,,()(),(

yyxx

yx

yx

htt

tvtv

tt

vvVTyx

++=

=

Page 14: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Matrix Form

�Why did we insist on using a Matrix form to

represent the transformations?

Hint: How would you go about transforming

an object of m vertices through a sequence of

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

14

an object of m vertices through a sequence of

n transformations?

Page 15: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Transformation Composition

� What operation rotates XY by θ around P = (px,py) ?

� Answer:

Translate P to origin

Rotate around origin by θ

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

15

Rotate around origin by θ

Translate back

Page 16: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Transformation Composition

=−−

0010sincos001

),(),( ppppTRT yxyx

θθθθ

θ

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

16

−− 1

010

100

0cossin-

1

010

yxyx pppp

θθ

Page 17: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Transformations Quiz

� What do these

transformations do?

� And these homogeneous

ones?

01

10

01

5.000

010

001

1-00

010

001

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

17

� How can one mirror a planar

object through an arbitrary

line in XY?

� Can one rotate a planar

object in the XY plane via

mirroring?

10

1

11

01

10

01

10

a

Page 18: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Rotate by Shear

� Shear

� Rotation by 0 ≤ θ ≤ π/2 ≡ composition of 3 shears

1011sincos zxθθ

1

01,

10

1,

10

11,

11

01

a

a

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

18

.1

1

10

1

1

1

10

1

1

01

10

1

cossin-

sincos

+

+++=

+=

=

yzy

xxyzzxy

z

y

xxy

z

y

x

θθθθ

Page 19: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Rotate by Shear (cont.)

� Solve for x, y, z :

cos θ = 1+xy = yz+1

sin θ = −y = z+xyz+x

.1

1

cossin-

sincos

+

+++=

yzy

xxyzzxy

θθθθ

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

19

� Solution:

y = −sin θx = z = −tan(θ / 2)

QuestionQuestion: When is rotation-using-three-shears useful?

QuestionQuestion: Can we derive a rotation via two shears?

Page 20: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Rotate by Shear (cont.)

� What does the composition of

the following two scaled shears

do?

=

θθθθ sincos0secsin1

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

20

� Why use it?

� Is it convenient?

� What happens when θ → π/2 ?

=

θθθθ

θθ

θθ

cossin-

sincos

1tan

0sec

cos0

sin1

Page 21: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Rotation Approximation

� For small angles can approximate:

x’=x cosθ − y sinθ ≅ x − yθy’=x sinθ + y cosθ ≅ xθ + y

Since cosθ → 1 and sinθ → θ as θ → 0 (Taylor expansion of sin/cos)

� Example (steps of θ ):

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

21

� When is this rotation approximation useful?

Page 22: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

� App. rotation matrix

� Matrix has to be orthogonal & normalized

Rotation Approximation

=1

1

θθθAR

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

22

� Matrix has to be orthogonal & normalized

� ARθ is orthogonal

� ARθ not normalized

�Normalize

2

1

1

1 θθ

θθ +=

−= cAR

cc

cc

Page 23: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

3D Transformations

� All 2D transformations extend to 3D

� In homogeneous coordinates:

Scale Translate Rotate (around z axis)

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

23

�� QuestionQuestion: What is ? ?

=

=

=

1000

0100

00cossin

00sincos

1

0100

0010

0001

1000

000

000

000

),,(),,( θθθθ

θz

zyx

ttt

z

y

x

sssR

ttt

Ts

s

s

S zyxzyx

θxR

θyR transformations

Page 24: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

3D Transformations

� Questions (commutativity):

Scaling: Is S1S2 = S2S1?

Translation: Is T1T2 = T2T1?

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

24

Rotation: Is R1R2 = R2R1?

Page 25: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Example: Arbitrary Rotation

YZ

W

V

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

25

� Problem:

Given two orthonormal coordinate systems XYZ and UVW ,

Find a transformation from one to the other.

X

U

Page 26: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Arbitrary Rotation

� Answer: Transformation matrix R

whose rows are U, V, W:

� Proof:

uuu

=

zyx

zyx

zyx

www

vvv

uuu

R

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

26

� Similarly R(Y) = V & R(Z) = W

U

uuu

www

vvv

uuu

XR

zyx

zyx

zyx

zyx

=

=

=

),,(

)0,0,1()(

Page 27: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

� Inverse (=transpose) transformation, R-1, provides

mapping from UVW to XYZ

� E.g.

Arbitrary Rotation (cont.)

wvu

wvu

uuuUR yyy

xxx

zyx

=− ),,()(1

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

27

� Comment: Used for mapping between XY plane and

arbitrary plane (why is this useful!?)

X

uuu

wvu

wvuuuuUR

zyx

zzz

yyyzyx

=

=

++=

=

)0,0,1(

)0,0,(

),,()(

222

Page 28: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

� Lemma: Affine image of line segment is line segment

between image of its end points

� Proof:

Given affine transformation A & line segment S(t) = P1t + P2(1-t)

Transformation of Objects

))1(())(( 21 tPtPAtSA −+=

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

28

� Is an affine image of a plane, a plane?

� Conclusion: polyhedron (polygon) is affinely transformed

by transforming its vertices

)()1()(

))1(()(

))1(())((

21

21

21

PAtPtA

tPAtPA

tPtPAtSA

−+=

−+=

−+=

Page 29: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Viewing Transformations� Question: How can we view (draw)

3D objects on a 2D screen?

� Answer:

Project the transformed object along Z

axis onto XY plane - and from there to

screen (space)

Canonical projection:ObjectObjectspacespace

ViewViewspacespace

ScreenScreenspacespace

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

29

Canonical projection:

1000

0000

0010

0001

� In practice “ignore” the z axis – simply use the x and y

coordinates for screen coordinates

z

ObjectObjectspacespace

ScreenScreenspacespace

Page 30: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Parallel Projection

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

30

Page 31: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Parallel Projection

� Projectors are all parallel

Orthographic: Projectors perpendicular to projection plane

Axonometric: Rotation + translation + orthographic projection

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

31

Page 32: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Parallel Projection� Projectors are all parallel

Oblique projection: Projectors not necessarily perpendicular to

projection plane

transformations

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

32

� When can the oblique projection used?

Page 33: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

What is Wrong in this Korean Picture?

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

33

Page 34: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Perspective Projection

� Viewing is from point at a

finite distance

� Without loss of generality:

Viewpoint at origin

projection

plane

X

p2 p3

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

34

Viewing plane is z=d

� Given P=(x, y, z), triangle

similarity gives:

dz

yy

dz

xx

d

y

z

y

d

x

z

xpp

pp

/ and

/ and ==⇒==

center of

projection

projectors

x2p

x1p= x3

p

z = d

p1= (x1, y1, z1)

Z

Page 35: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

� In matrix notation with homogeneous coordinates:

Perspective Projection (cont’d)

.,,,

0000

/1100

0010

0001

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

=

=d

zzyx

dzyxzyxP

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

35

� In Euclidean coordinates:

� P not injective & singular: det(P)=0

0000

).,,(,/

,//

,/

,/

dyxddz

y

dz

x

dz

z

dz

y

dz

xpp=

=

transformations

Page 36: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Perspective Projection (cont’d)� What is (if any) the difference between:

Moving the projection plane

camtrans

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

36

Moving the viewpoint (center of projection)?

Page 37: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Examples of Perspective projection

Perspective could be defined with

one, two or three focal points:

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

37

Page 38: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Examples of Perspective projection

The same model in

Orthographic view Perspective view

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

38

Page 39: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Examples of Perspective projection

The same model with

Small perspective warp Large perspective warp

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

39

Page 40: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

More than Three Points’ Perspective!?

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

40

Page 41: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Perspective Warp� P not invertible – can not get depth (order) back.

� Idea:

Warp the viewing frustum (and the entire world)

Then use parallel projection

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

41

Question: Why

do we require

the depth

information?

Page 42: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Perspective Warp

� Matrix formulation

−=

− d

z

d

dzyx

dd

dzyx ,

)(,,

100

0010

0001

)1,,,(α

α

α

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

42

� This matrix maps the x and y coordinates much like

the perspective map in slide 34.

−−

− dd

d

ddd

000

α

αα

α

( )( )

−−

=zd

zd

dz

y

dz

xzyx ppp α

α2

,/

,/

),,(

Page 43: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Perspective Warp

� What does α = 0 mean? α = d ?

� What is the effect of changing d, d >α ?

� The perspective warp preserves relative depth (third

coordinate). For what depth domain? Prove it!

( )( )

−−

=zd

zd

dz

y

dz

xzyx ppp α

α2

,/

,/

),,(

camtrans

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

43

coordinate). For what depth domain? Prove it!

� The perspective warp preserves planes (prove it!)

� Plane Ax + By + Cz + D = 0 is warped to (prove it!):

Aαdxp + Bαdyp + D(α − d)zp + Cαd2 + Dd2 = 0

� What does warp do to other objects? Spheres?

Page 44: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Perspective Warp� We will show that the six faces of the

view frustum are mapped to six faces

of a box

� Plane z = d (d ≠ 0), A=B=0, C=1, D=-d and the plane is

warped to -d(α -d)zp+α d2 - d3 = 0 or zp = d

Ax + By + Cz + D = 0 ⇒ Aαdxp + Bαdyp + D(α − d)zp + Cαd2 + Dd2 = 0

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

44

p p

� Plane z = α (α ≠ 0), A=B=0, C=1, D=-α and the plane is

warped to -α(α -d)zp+α d2 -α d2 = 0 or zp = 0

� Plane x = ±z, A=1, B=0, C= ±1, D=0 and the plane is

warped to αdxp ± α d2 = 0 or xp = ± d

� Plane y = ±z, A=0, B=1, C= ±1, D=0 and the plane is

warped to αdyp ± α d2 = 0 or yp = ± d

Page 45: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

What is the difference between

O = M No & O = N M o, N new transform

Page 46: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Another Transformations Quiz� What does each transformation preserve?

linesparallel

linesdistance angles normals convexity

Conics

(spherity)

scaling

rotation

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

46

� A map that preserves angles is called conformal.

� A map that preserves distances is called an Isometry.

translation

shear

perspective

Page 47: Transformations - Technion – Israel Institute of …webcourse.cs.technion.ac.il/.../ho/WCFiles/Transformations-bw.pdf · Geometric Transformations Transformation τis one-to-one

Everything is a matter of Perspective

Sidewalk Chalk PaintingsSidewalk Chalk Paintings

Transformations Transformations -- Center for Graphics and Geometric Computing, Center for Graphics and Geometric Computing,

TechnionTechnion

47

Julian Julian BeeverBeever