3d viewing transformation - iit delhi

Post on 26-May-2022

3 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

3D ViewingProjections

AProjectors

Projection PlaneCenter ofProjection

B

B’

A’

Perspective

3D ViewingProjections

Parallel

Projectors

Projection PlaneAt Infinity

A’

B’

A

B

3D ViewingParallel Projections

Orthographic

Side ViewFront View

Top View

Z X

Y

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

3D ViewingParallel Projections

Orthographic

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 +=+=+=

3D ViewingParallel Projections

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

Axonometric

3D ViewingParallel Projections

Trimetric

zyx fff ≠≠Dimetric

zy ff =Isometric

zyx fff ==

Axonometric

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

3D ViewingParallel Projections

Isometric

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

−=

1000

00sincossin

00cos0

00sinsincos

èöö

è

èöö

T

3D ViewingParallel Projections

[ ][ ]

−=

=

10sincossin

10cos0

10sinsincos1000

00sincossin

00cos0

00sinsincos

1100

1010

1001

èöö

è

èöö

èöö

è

èöö

TU

Isometric

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

3D ViewingParallel Projections

èèööff

èèööff

ffff

zy

yx

zyx

2222

2222

cossincossin

cossinsincos

=+⇒=

=+⇒=

===

Solving equations find θ, φ and f

Isometric

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

3D ViewingParallel Projections

Oblique

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

αφ

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

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’

3D ViewingPerspective Projections

3D ViewingPerspective Projections

Matrix Form

[ ] [ ]

[ ]

+++=

+=

1111

1

1

1000

100

0010

0001

1

***

rzz

rzy

rzx

zyx

rzzyxr

zyx

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

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

*

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

3D ViewingPerspective Projections

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

VPzY

Z

X

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

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)

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)

3D ViewingPerspective Projections

Two Point Perspective

[ ][ ]

==

1000

0100

010

001

q

p

PPP qppq

3D ViewingPerspective Projections

Three Point Perspective

[ ][ ][ ]

=

=

1000

100

010

001

P P qp

r

q

p

PP rpqr

3D ViewingPerspective Projections

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

3D ViewingGeneration of Perspective Views

X

Y

Translation along y=x line:

3D ViewingGeneration of Perspective Views

Translation in Z => Scaling

COP

Projection plane

3D ViewingGeneration of Perspective Views

Rotation

[ ][ ]

==

1000

000

0010

0001

1000

0cos0sin

0010

0sin0cos

röö

öö

PRT rzy

Rotation about Y-axis by φ

3D ViewingGeneration of Perspective Views

RotationRotation about Y-axis by φ

[ ][ ]

==

1000

cos00sin

0010

sin00cos

örö

örö

PRT rzy

=> Two Point Perspective Transformation

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

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

top related