3d viewing transformation - iit delhi

37
3D Viewing Projections A Projectors Projection Plane Center of Projection B B’ A’ Perspective

Upload: others

Post on 26-May-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 3D Viewing Transformation - IIT Delhi

3D ViewingProjections

AProjectors

Projection PlaneCenter ofProjection

B

B’

A’

Perspective

Page 2: 3D Viewing Transformation - IIT Delhi

3D ViewingProjections

Parallel

Projectors

Projection PlaneAt Infinity

A’

B’

A

B

Page 3: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

Orthographic

Side ViewFront View

Top View

Z X

Y

Page 4: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

• Multiviews (x=0 or y=0 or z=0 planes),one View is not adequate

• True size and shape for lines

On z=0 plane

Orthographic

=

1000

0000

0010

0001

P

Page 5: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

Orthographic

Page 6: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

Axonometric

• Additional rotation,translation and thenprojection on z=0 plane

[ ][ ] [ ]

=

=

10

10

10

1100

1010

1001

**

**

**

zz

yy

xx

yx

yx

yx

TTU

2*2*2*2*2*2* ;; zzzyyyxxx yxfyxfyxf +=+=+=

Page 7: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

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

Axonometric

Page 8: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

Trimetric

zyx fff ≠≠Dimetric

zy ff =Isometric

zyx fff ==

Axonometric

Page 9: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

Isometric

Let there be 2 rotations a) about y-axis φb) about x-axis θ

=

1000

0000

0010

0001

1000

0cossin0

0sincos0

0001

1000

0cos0sin

0010

0sin0cos

èè

èè

öö

öö

T

Page 10: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

Isometric

Let there be 2 rotations a) about y-axis φb) about x-axis θ

−=

1000

00sincossin

00cos0

00sinsincos

èöö

è

èöö

T

Page 11: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

[ ][ ]

−=

=

10sincossin

10cos0

10sinsincos1000

00sincossin

00cos0

00sinsincos

1100

1010

1001

èöö

è

èöö

èöö

è

èöö

TU

Isometric

Page 12: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

sin cossin

cos

sin sincos

2 2 2 2*2*2

2 2*2*2

2 2 2 2*2*2

èööyxf

èyxf

èööyxf

zzz

yyy

xxx

+=+=

=+=+=+=

Isometric

Page 13: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

èèööff

èèööff

ffff

zy

yx

zyx

2222

2222

cossincossin

cossinsincos

=+⇒=

=+⇒=

===

Solving equations find θ, φ and f

Isometric

Page 14: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

Oblique

• Non-perpendicular projectors to the plane of projection

• True shape and size for the faces parallel to the projection plane is preserved

Page 15: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

Oblique

Page 16: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

Oblique

P(x,y,z)

P’(x,y)

P’’(xp,yp)

z

x

y

xp = x + L cos φyp = y + L sin φ

tan α =z/L or L = z cot αL

αφ

Page 17: 3D Viewing Transformation - IIT Delhi

3D ViewingParallel Projections

Oblique

P(x,y,z)

P’(x,y)

P’’(xp,yp)

z

x

y

φ

When α =45o => CavalierLines perpendicular to the projection plane are not foreshortened

When cot α = ½ => CabinetLines perpendicular to the projection plane are foreshortened by half

φ is typically 300 or 450

Page 18: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

• Parallel lines converge• Non-uniform foreshortening• Helps in depth perception, important for 3D viewing• Shape is not preserved

AProjectors

Projection PlaneCenter ofProjection

B

B’

A’

Page 19: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Page 20: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Matrix Form

[ ] [ ]

[ ]

+++=

+=

1111

1

1

1000

100

0010

0001

1

***

rzz

rzy

rzx

zyx

rzzyxr

zyx

Page 21: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Matrix Form

Projection on z=0 plane

[ ][ ]

[ ]

++=

===

1011

1

1000

0000

0010

0001

1000

100

0010

0001

***

rzy

rzx

zyx

rPPPT zrrz

Page 22: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Geometrically

Z

P(x,y,z) X

Y

P*(x*,y*)

zc

y

l2

l1y*

c

c

c

zz

yy

lll

zzz

lly

ly

−=⇒

−=

−−=

1

,

*

12

2

122

*

Page 23: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Geometrically

Z

P(x,y,z) X

Y

P*(x*,y*)

zc

l2

l1xx*

zc

c

cc

zz

xx

zzx

zx

−=⇒

−=

1

**

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

Page 24: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Vanishing PointSet of parallel lines not parallel to the projection planeconverge to Vanishing Point

VPzY

Z

X

Page 25: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Vanishing Point

Point at infinity on +Z axis : (homogenous)[ ]0100

[ ] [ ]

[ ][ ] [ ]11001

1001000

100

0010

0001

0100

***

'''

rzyx

r

rwzyx

=

=

=

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

Page 26: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Single Point Perspective

[ ] [ ]

[ ]

+++=

+=

1111

1

1

1000

0100

0010

001

1

***

pxz

pxy

pxx

zyx

pxzyx

p

zyx

COP on X-axis

COP (-1/p 0 0 1) VPx (1/p 0 0 1)

Page 27: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Single Point Perspective

[ ] [ ]

[ ]

+++=

+=

1111

1

1

1000

0100

010

0001

1

***

qyz

qyy

qyx

zyx

qyzyxq

zyx

COP on Y-axis

COP (0 -1/q 0 1) VPx (0 1/q 0 1)

Page 28: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Two Point Perspective

[ ][ ]

==

1000

0100

010

001

q

p

PPP qppq

Page 29: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Three Point Perspective

[ ][ ][ ]

=

=

1000

100

010

001

P P qp

r

q

p

PP rpqr

Page 30: 3D Viewing Transformation - IIT Delhi

3D ViewingPerspective Projections

Page 31: 3D Viewing Transformation - IIT Delhi

3D ViewingGeneration of Perspective Views

Additional transformation and then single pointperspective transformation

Simple Translation:Translation (l,m,n),COP=zc ,Projection plane z=0

+

=

=

rnml

rr

nml

T

10

000

0010

0001

1000

000

0010

0001

1

0100

0010

0001

Page 32: 3D Viewing Transformation - IIT Delhi

3D ViewingGeneration of Perspective Views

X

Y

Translation along y=x line:

Page 33: 3D Viewing Transformation - IIT Delhi

3D ViewingGeneration of Perspective Views

Translation in Z => Scaling

COP

Projection plane

Page 34: 3D Viewing Transformation - IIT Delhi

3D ViewingGeneration of Perspective Views

Rotation

[ ][ ]

==

1000

000

0010

0001

1000

0cos0sin

0010

0sin0cos

röö

öö

PRT rzy

Rotation about Y-axis by φ

Page 35: 3D Viewing Transformation - IIT Delhi

3D ViewingGeneration of Perspective Views

RotationRotation about Y-axis by φ

[ ][ ]

==

1000

cos00sin

0010

sin00cos

örö

örö

PRT rzy

=> Two Point Perspective Transformation

Page 36: 3D Viewing Transformation - IIT Delhi

3D ViewingGeneration of Perspective Views

RotationTwo Rotations a) about Y-axis by φ

b) about X-axis by θ

[ ][ ][ ]

=

=

1000

000

0010

0001

1000

0cossin0

0sincos0

0001

1000

0cos0sin

0010

0sin0cos

rèè

èè

öö

öö

PRRT rzxy

Page 37: 3D Viewing Transformation - IIT Delhi

3D ViewingGeneration of Perspective Views

=

1000

coscos0sincossin

sin0cos0

cossin0sinsincos

èörèöö

èrè

èörèöö

T

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

Rotation

=> Three Point Perspective Transformation