Scaling 4x4 matrix s 0 0 0 x 0 s 0 0 1 1 1 y 1 - - PowerPoint PPT Presentation

scaling
SMART_READER_LITE
LIVE PREVIEW

Scaling 4x4 matrix s 0 0 0 x 0 s 0 0 1 1 1 y 1 - - PowerPoint PPT Presentation

Scaling 4x4 matrix s 0 0 0 x 0 s 0 0 1 1 1 y 1 S S ( s , s , s ) S ( , , ) = = x y z 0 0 s 0 s s s z x y z 0 0 0 1 Non-rigid


slide-1
SLIDE 1

Scaling

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 1

z y x

s s s S

  • 4x4 matrix

Non-rigid transformation Special value (-1) of scaling factor give reflection

) 1 , 1 , 1 ( ) , , (

1 z y x z y x

s s s S s s s S =

slide-2
SLIDE 2

Rotation

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = 1 cos sin sin cos 1 θ θ θ θ Rx

  • About X-axis

X Y Z

slide-3
SLIDE 3

Rotation

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = 1 1 cos sin sin cos ψ ψ ψ ψ Rz

  • About Z-axis

X Y Z

slide-4
SLIDE 4

Rotation

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = 1 cos sin 1 sin cos φ φ φ φ Ry

  • About Y-axis

X Y Z

slide-5
SLIDE 5

Rotations

) ( ) (

1

θ R θ R − =

) ( ) (

1

θ R θ R

T

=

Orthogonal Matrix Rigid Transformation

slide-6
SLIDE 6

Translation

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 1 1 1 n m l T

Rigid transformation

) , , ( ) , , (

1

n m l T n m l T − − − =

slide-7
SLIDE 7

Shear

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 1 1 1 h g f d c b S

Off diagonal elements Non-rigid transformation

slide-8
SLIDE 8

Shear

X Y θ

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 1 1 1 θ θ cot ) (

yz

H z z y y θ y x x = = + = ' ' cot '

(x, y) (x’, y’)

) ( ) (

1

θ H θ H

yz yz

− =

slide-9
SLIDE 9

Concatenation of Transformations

3 2 1 3 2 1

) ) ) ((( T T XT T T XT X' = = XT X T T T T = = '

3 2 1

Transformations: T1, T2, T3 T1 T2 T3 X X’ Alternatively, X X’ T Pipeline unit T1 T2 T3

slide-10
SLIDE 10

Rotation about a fixed point

Rotation of a cube about its center (about Z-axis) X Y Z C

) ( ) ( ) ( C T θ R C XT X' − =

slide-11
SLIDE 11

Rotation about an arbitrary axis

X Y Z O P Axis: P0 (x0, y0, z0), (Cx, Cy, Cz) Angle: δ OP: Unit vector O: (x0, y0, z0) Translation (-x0, -y0, -z0) Cx Cz Cy

slide-12
SLIDE 12

Rotation about an arbitrary axis

X Y Z O P Axis: P0 (x0, y0, z0), (Cx, Cy, Cz) Angle: δ Rotation about X axis by α Cx Cz Cy α

d C α d C α

y z

= = sin cos

d

slide-13
SLIDE 13

Rotation about an arbitrary axis

X Y Z O Axis: P0 (x0, y0, z0), (Cx, Cy, Cz) Angle: δ Rotation about X axis by α Cx d

x

C β d β = = sin cos

d β 1

slide-14
SLIDE 14

Rotation about an arbitrary axis

Complete Transformation

) ( ) ( ) ( ) ( ) ( ) ( ) ( P T α R β R δ R β R α R P T M

x y z y x

− − − =

slide-15
SLIDE 15

General

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = s n m l r i h g q f e d p c b a S

slide-16
SLIDE 16

Projections

A

Projectors Projection Plane Center of Projection

B B’ A’

Perspective

slide-17
SLIDE 17

Projections

Parallel

Projectors Projection Plane At Infinity

A’ B’ A B

slide-18
SLIDE 18

Parallel Projections

Orthographic

Side View Front View Top View Z X Y

slide-19
SLIDE 19

Parallel Projections

  • Multiviews

(x=0 or y=0 or z=0 planes),

  • ne View is not adequate
  • True size and shape for lines

On z=0 plane Orthographic ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 1 1 P

slide-20
SLIDE 20

Parallel Projections

Orthographic

slide-21
SLIDE 21

Parallel Projections

Axonometric

  • Additional rotation,translation and then

projection on z=0 plane

[ ][ ] [ ]

⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 1 1 1 1 1 1 1 1

* * * * * * z z y y x x

y x y x y x T T U

2 * 2 * 2 * 2 * 2 * 2 *

; ;

z z z y y y x x x

y x f y x f y x f + = + = + =

slide-22
SLIDE 22

Parallel Projections

Three types

  • Trimetric: No foreshortening is the same.
  • Dimetric: Two foreshortenings are the same.
  • Isometric: All foreshortenings are the same.

Axonometric

slide-23
SLIDE 23

Parallel Projections

Trimetric

z y x

f f f ≠ ≠

Dimetric

z y

f f =

Isometric

z y x

f f f = =

Axonometric

slide-24
SLIDE 24

Parallel Projections

Isometric Let there be 2 rotations a) about y-axis φ

b) about x-axis θ

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = 1 1 1 1 cos sin sin cos 1 1 cos sin 1 sin cos θ θ θ θ φ φ φ φ T

slide-25
SLIDE 25

Parallel Projections

Isometric Let there be 2 rotations a) about y-axis φ

b) about x-axis θ

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = 1 sin cos sin cos sin sin cos θ φ φ θ θ φ φ T

slide-26
SLIDE 26

Parallel Projections

[ ][ ]

⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 sin cos sin 1 cos 1 sin sin cos 1 sin cos sin cos sin sin cos 1 1 1 1 1 1 θ φ φ θ θ φ φ θ φ φ θ θ φ φ T U

Isometric

slide-27
SLIDE 27

Parallel Projections sin cos sin cos sin sin cos

2 2 2 2 * 2 * 2 2 2 * 2 * 2 2 2 2 2 * 2 * 2

θ φ φ y x f θ y x f θ φ φ y x f

z z z y y y x x x

+ = + = = + = + = + =

Isometric

slide-28
SLIDE 28

Parallel Projections

θ θ φ φ f f θ θ φ φ f f f f f f

z y y x z y x 2 2 2 2 2 2 2 2

cos sin cos sin cos sin sin cos = + ⇒ = = + ⇒ = = = =

Solving equations find θ, φ and f Isometric

slide-29
SLIDE 29

Parallel Projections

Oblique

  • Non-perpendicular projectors

to the plane of projection

  • True shape and size for the

faces parallel to the projection plane is preserved

slide-30
SLIDE 30

Parallel Projections

Oblique

slide-31
SLIDE 31

Parallel Projections

Oblique

P(x,y,z) P’(x,y) P’’(xp,yp)

z y x

xp = x + L cos φ yp = y + L sin φ tan α =z/L or L = z cot α

L α φ

slide-32
SLIDE 32

Parallel Projections

Oblique

P(x,y,z) P’(x,y) P’’(xp,yp)

z y

L α φ

When α =45o => Cavalier Lines perpendicular to the projection plane are not foreshortened When cot α = ½ => Cabinet Lines perpendicular to the projection plane are foreshortened by half φ is typically 300 or 450 x

slide-33
SLIDE 33

Perspective Projections

  • Parallel lines converge
  • Non-uniform

foreshortening

  • Helps in depth

perception, important for 3D viewing

  • Shape is not preserved

A

Projectors Projection Plane Center of Projection

B B’ A’

slide-34
SLIDE 34

Perspective Projections

slide-35
SLIDE 35

Perspective Projections

Matrix Form

[ ] [ ]

[ ]

⎥ ⎦ ⎤ ⎢ ⎣ ⎡ + + + = + = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ 1 1 1 1 1 1 1 1 1 1 1

* * *

rz z rz y rz x z y x rz z y x r z y x

slide-36
SLIDE 36

Perspective Projections

Matrix Form Projection on z=0 plane

[ ][ ]

[ ]

⎥ ⎦ ⎤ ⎢ ⎣ ⎡ + + = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = = = 1 1 1 1 1 1 1 1 1 1 1

* * *

rz y rz x z y x r P P P T

z r rz

slide-37
SLIDE 37

Perspective Projections

Geometrically

Z

P(x,y,z)

X Y

P*(x*,y*)

zc y l2 l1 y*

c c c

z z y y l l l z z z l l y l y − = ⇒ − = − − = 1 ,

* 1 2 2 1 2 2 *

slide-38
SLIDE 38

Perspective Projections

Geometrically

Z

P(x,y,z)

X Y

P*(x*,y*)

zc l2 l1 x x* zc

c c c

z z x x z z x z x − = ⇒ − = 1

* *

When r = - 1/ zc this becomes same as obtained in matrix form

slide-39
SLIDE 39

Perspective Projections

Vanishing Point Set of parallel lines not parallel to the projection plane converge to Vanishing Point

VPz Y Z X

slide-40
SLIDE 40

Perspective Projections

Vanishing Point Point at infinity on +Z axis : (homogenous)

[ ]

1

[ ]

[ ] [ ]

[ ] [

]

1 1 1 1 1 1 1 1 1

* * * ' ' '

r z y x r r w z y x = = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ =

Recall r = -1/zc, the vanishing point is at -zc

slide-41
SLIDE 41

Perspective Projections

Single Point Perspective

[ ] [ ]

[ ]

⎥ ⎦ ⎤ ⎢ ⎣ ⎡ + + + = + = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ 1 1 1 1 1 1 1 1 1 1 1

* * *

px z px y px x z y x px z y x p z y x

COP on X-axis COP (-1/p 0 0 1) VPx (1/p 0 0 1)

slide-42
SLIDE 42

Perspective Projections

Single Point Perspective

[ ] [ ]

[ ]

⎥ ⎦ ⎤ ⎢ ⎣ ⎡ + + + = + = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ 1 1 1 1 1 1 1 1 1 1 1

* * *

qy z qy y qy x z y x qy z y x q z y x

COP on Y-axis COP (0 -1/q 0 1) VPx (0 1/q 0 1)

slide-43
SLIDE 43

Perspective Projections

Two Point Perspective

[ ][ ]

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = = 1 1 1 1 q p P P P

q p pq

slide-44
SLIDE 44

Perspective Projections

Three Point Perspective

[ ][ ][

]

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = = 1 1 1 1 P P

q p

r q p P P

r pqr

slide-45
SLIDE 45

Perspective Projections

slide-46
SLIDE 46

Generation of Perspective Views

Additional transformation and then single point perspective transformation Simple Translation: Translation (l,m,n),COP=zc ,Projection plane z=0

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ + = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = rn m l r r n m l T 1 1 1 1 1 1 1 1 1 1

slide-47
SLIDE 47

Generation of Perspective Views

X Y

Translation along y=x line:

slide-48
SLIDE 48

Generation of Perspective Views

Translation in Z => Scaling

COP Projection plane

slide-49
SLIDE 49

Generation of Perspective Views

Rotation

[ ][

]

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = = 1 1 1 1 cos sin 1 sin cos r φ φ φ φ P R T

rz y

Rotation about Y-axis by φ

slide-50
SLIDE 50

Generation of Perspective Views

Rotation Rotation about Y-axis by φ

[ ][

]

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = = 1 cos sin 1 sin cos φ r φ φ r φ P R T

rz y

=> Two Point Perspective Transformation

slide-51
SLIDE 51

Generation of Perspective Views

Rotation Two Rotations a) about Y-axis by φ b) about X-axis by θ [ ][

][ ]

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − = = 1 1 1 1 cos sin sin cos 1 1 cos sin 1 sin cos r θ θ θ θ φ φ φ φ P R R T

rz x y

slide-52
SLIDE 52

Generation of Perspective Views

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − = 1 cos cos sin cos sin sin cos cos sin sin sin cos θ φ r θ φ φ θ r θ θ φ r θ φ φ T

Two Rotations a) about Y-axis by φ b) about X-axis by θ Rotation => Three Point Perspective Transformation

slide-53
SLIDE 53

Vanishing Points

Two ways

  • Intersection of transformed lines
  • Transformation of points at infinity

X Z Y Y X VPx VPz

slide-54
SLIDE 54

Orthographic

Plane Geometric Projections

Parallel Perspective Axonometric Oblique Trimetric Dimetric Isometric Cavalier Cabinet Single Point Two Point Three Point

slide-55
SLIDE 55

[ ] [ ] [ ]

T

M r p M r p c b a r M c b a z y x p ) ( ) (

1

− = − = + = =

Transformation from WCS to VCS

Conversion from one coordinate system to another Therefore a=(p-r).u, b=(p-r).v, c=(p-r).n

slide-56
SLIDE 56

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 ? ? ?

T wv

M A

In Homogenous Coordinates (a,b,c,1) = (x,y,z,1) Awv

Transformation from WCS to VCS

slide-57
SLIDE 57

[ ]

  • n

translatio T T T

rM pM M r p c b a − = − = ) (

In Homogenous Coordinates r’= -rMT = (-r.u,-r.v,-r.n) = (rx’,ry’,rz’) puvn=pxyzAwv

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ = 1 ' ' ' 1 ' ' '

z y x z z z y y y x x x z y x T wv

r r r n v u n v u n v u r r r M A

Transformation from WCS to VCS

slide-58
SLIDE 58

Transformation from VCS to View Plane

e t=0 p* p t=1 t=t’ u n v e p (pu,pv,pn) p*(u*,v*)

Parametrically r(t) = e(1-t)+p.t

slide-59
SLIDE 59

Transformation from VCS to View Plane

On u-v plane, r(t)n = 0

n n n v v n n n n u u n n n n n n

p e p e p e v p e p e p e u p e e t t p t e − − = − − = − = + − =

* * ' ' '

) ( ) 1 (

slide-60
SLIDE 60

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − =

1 1 1 1

1 n p

e M When eye is on n-axis eu=ev=0 u*=pu/(en-pn), v*=pv/(en-pn) Matrix form (n*=0) Perspective Transformation ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ −

1 1 1

1 n

e

Transformation from VCS to View Plane

slide-61
SLIDE 61

Using Perspective Transformation Mp

Transformation from VCS to View Plane

) depth pseudo ( ) 1 , , , ( ) , , (

* * * * * * * n n n n n v n n u p n v u

p e p n p e p v p e p u M p p p n v u p − = − = − = = =

slide-62
SLIDE 62

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − =

− −

1 1 1 1

1 1 n v n u s

e e e e M

p*=(pu,pv,pn,1)MsMp q : in WCS maps to p*=qAwvMsMp

Transformation from VCS to View Plane

If eye is off n-axis we have another matrix