3d viewing perspective projections single point perspective cop on x-axis cop (-1/p 0 0 1) vp x (1/p...
TRANSCRIPT
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
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 ViewingVanishing Points
Two ways• Intersection of transformed lines• Transformation of points at infinity
X
Z
Y
Y
X
VPx
VPz
3D Viewing
Orthographic
Plane Geometric Projections
Parallel Perspective
Axonometric Oblique
Trimetric Dimetric Isometric
Cavalier Cabinet
Single Point
Two Point
Three Point
3D ViewingImplementation Issues
More from Interface point of view
Y
Z
X
Eye
N
V
U
World Coordinate System (WCS)
Viewing Coordinate System (VCS)
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 )
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)
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)
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
3D ViewingTransformation from WCS to VCS
rba
rv
ubayx
M ) (
) () (
(x, y)
X
Y
O
O’
u
v
r
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
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
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
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
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
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
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
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
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
3D ViewingView Volume
Back Plane n=B
Front Plane n=F
View Plane, n=0Eye
3D ViewingView Volume
v v
n n
wt
wb
wt
wbF B
F/(1-F/en) B/(1-B/en)
3D ViewingVolume Normalization Transformation
Vt
Vb
Vl Vr
0
1v
u
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
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