3d viewing perspective projections single point perspective cop on x-axis cop (-1/p 0 0 1) vp x (1/p...

28

Upload: austin-hancock

Post on 28-Dec-2015

225 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)
Page 2: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

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 3: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingPerspective Projections

Two Point Perspective

1000

0100

010

001

q

p

PPP qppq

Page 4: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingPerspective Projections

Three Point Perspective

1000

100

010

001

P P qp

r

q

p

PP rpqr

Page 5: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingPerspective Projections

Page 6: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingVanishing Points

Two ways• Intersection of transformed lines• Transformation of points at infinity

X

Z

Y

Y

X

VPx

VPz

Page 7: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

Orthographic

Plane Geometric Projections

Parallel Perspective

Axonometric Oblique

Trimetric Dimetric Isometric

Cavalier Cabinet

Single Point

Two Point

Three Point

Page 8: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingImplementation Issues

More from Interface point of view

Y

Z

X

Eye

N

V

U

World Coordinate System (WCS)

Viewing Coordinate System (VCS)

Page 9: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingView Coordinate System (VCS)

Viewing coordinate system• Position and orientation of the view plane• Extent of the view plane (window)• Position of the eye

View Plane• View Reference Point (VRP): the origin of VCS specified as (rx , ry, rz) in WCS: center of the scene• Normal to the view plane (nx , ny, nz )

Page 10: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

View Plane• Normal Direction (View Plane Normal VPN) n (nx ,ny ,nz)

User may provide normalized vectore.g.

nx = sin cos ny = sin sin

nz = cos

Z

Y

r

X

View Coordinate System (VCS)

Page 11: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

View Plane• Direction vv is a unit vector intuitively corresponding to “up” vector“up” vector is specified by the user in WCS

n

upup’

v

up’ = up – (up.n)n

v = up’ / |up’|

• Direction u

u = n x v ( Left Handed)

View Coordinate System (VCS)

Page 12: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

Window and Eye

• Window : left, right, bottom,top (wl,wr,wb,wt) generally is centered at VRP (origin)

• Eye : e = (eu,ev,en) Typically e = (0,0,-E)

View Coordinate System (VCS)

u

e

wt

wb

wr

wl

n v

Page 13: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingTransformation from WCS to VCS

rba

rv

ubayx

M ) (

) () (

(x, y)

X

Y

O

O’

u

v

r

Page 14: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingTransformation from WCS to VCS

Point object is represented as • (a,b,c) in VCS• (x,y,z) in WCS

zyx

zyx

zyx

nnn

vvv

uuu

n

v

u

M

Page 15: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

TMrp

Mrpcba

rMcbazyxp

)(

)(

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

Page 16: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

1???

0

0

0T

wv

MA

In Homogenous Coordinates

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

Transformation from WCS to VCS

Page 17: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

ntranslatio

TTT rMpMMrpcba )(

In Homogenous Coordinates

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

1'''

0

0

0

1'''

0

0

0

zyx

zzz

yyy

xxx

zyx

T

wv

rrr

nvu

nvu

nvu

rrr

MA

Transformation from WCS to VCS

Page 18: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingTransformation from VCS to View Plane

et=0

p*

pt=1

t=t’

unv

e

p (pu,pv,pn)

p*(u*,v*)

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

Page 19: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingTransformation from VCS to View Plane

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

nn

nvvn

nn

nuun

nn

n

nn

pepepe

v

pepepe

u

pee

t

tpte

*

*

'

'' )()1(0

Page 20: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

1000

100

0010

0001

1

n

p eM

When eye is on n-axis eu=ev=0u*=pu/(en-pn), v*=pv/(en-pn)

Matrix form (n*=0) Perspective Transformation

1000

000

0010

0001

1

ne

Transformation from VCS to View Plane

Page 21: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

Using Perspective Transformation Mp

Transformation from VCS to View Plane

)depth pseudo(

)1,,,(),,(

*

*

*

****

nn

n

nn

v

nn

u

pnvu

pep

n

pep

v

pep

u

Mpppnvup

Page 22: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

1000

01

0010

0001

11

nvnu

s eeeeM

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

Page 23: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingView Volume

Back Plane n=B

Front Plane n=F

View Plane, n=0Eye

Page 24: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingView Volume

v v

n n

wt

wb

wt

wbF B

F/(1-F/en) B/(1-B/en)

Page 25: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingVolume Normalization Transformation

Vt

Vb

Vl Vr

0

1v

u

Page 26: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D ViewingVolume Normalization Transformation

F/(1-F/en) B/(1-B/en)

no

0

nt

1

For n

)()(

)(

))((

11

1

2 BFeBeF

FBe

nBeFe

eFF

eBB

eFF

n

nn

n

n

onn

nn

n

o

t

Scaling sn Translation rn

Page 27: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)

3D Viewing

1

000

000

000

nvu

n

v

n

rrr

s

s

s

N )(/)))(((

)/()()/()(

2 FBeFeBes

wwvvswwvvs

nnnn

btbtv

rlrlu

Volume Normalization Transformation

where

)(/)(

)/()()/()(

BFeBeFr

wwwvwvrwwwvwvr

nnn

btbttbv

rlrllru

Total Transformation: AwvMsMpN

Page 28: 3D Viewing Perspective Projections Single Point Perspective COP on X-axis COP (-1/p 0 0 1) VP x (1/p 0 0 1)