You are on page 1of 22

3D Viewing

Vanishing Points
Two ways
Intersection of transformed lines
Transformation of points at infinity
X
Z
Y
Y
X
VP
x
VP
z
3D Viewing
Orthographic
Plane Geometric Projections
Parallel Perspective
Axonometric Oblique
Trimetric Dimetric Isometric
Cavalier Cabinet
Single Point
Two Point
Three Point
3D Viewing
Implementation Issues
More from Interface point of view
Y
Z
X
Eye
N
V
U
World Coordinate System
(WCS)
Viewing Coordinate
System (VCS)
3D Viewing
View 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 (r
x
, r
y
, r
z
) in WCS: center of the scene
Normal to the view plane (n
x
, n
y
, n
z
)
3D Viewing
View Plane
Normal Direction (View Plane Normal
VPN) n (n
x
,n
y
,n
z
)
User may provide normalized vector
e.g.
n
x
= sin cos
n
y
= sin sin
n
z
= cos
Z
Y

r
X

View Coordinate System (VCS)


3D Viewing
View Plane
Direction v
v is a unit vector intuitively corresponding to up vector
up vector is specified by the user in WCS
n
up
up
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 (w
l
,w
r
,w
b
,w
t
)
generally is centered at VRP (origin)
Eye : e = (e
u
,e
v
,e
n
)
Typically e = (0,0,-E)
View Coordinate System (VCS)
u
e
w
t
w
b
w
r
w
l
n
v
3D Viewing
Transformation from WCS to VCS
r b a
r
v
u
b a y x
+
+
,
_

M ) (
) ( ) (
(x, y)
X
Y
O
O
u
v
r
3D Viewing
Transformation from WCS to VCS
Point object is represented as
(a,b,c) in VCS
(x,y,z) in WCS
1
1
1
]
1

1
1
1
]
1

z y x
z y x
z y x
n n n
v v v
u u u
n
v
u
M
3D Viewing
[ ] [ ]
[ ]
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
3D Viewing
1
1
1
1
]
1

1 ? ? ?
0
0
0
T
wv
M
A
In Homogenous Coordinates
(a,b,c,1) = (x,y,z,1) A
wv
Transformation from WCS to VCS
3D Viewing
[ [ ] ]
3 2 1
n translatio
T T T
rM pM M r p c b a = = = = ) (
In Homogenous Coordinates
r= -rM
T
= (-r.u,-r.v,-r.n) = (r
x
,r
y
,r
z
)
p
uvn
=p
xyz
A
wv
1
1
1
1
]
1

1
1
1
1
]
1

1 ' ' '


0
0
0
1 ' ' '
0
0
0
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
3D Viewing
Transformation from VCS to View Plane
e
t=0
p*
p
t=1
t=t
u
n
v
e
p (p
u
,p
v
,p
n
)
p*(u*,v*)
Parametrically r(t) = e(1-t)+p.t
3D Viewing
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 ( 0
3D Viewing













= =

1 0 0 0
1 0 0
0 0 1 0
0 0 0 1
1
n
p
e
M
When eye is on n-axis e
u
=e
v
=0
u*=p
u
/(e
n
-p
n
), v*=p
v
/(e
n
-p
n
)
Matrix form (n*=0) Perspective Transformation














1 0 0 0
0 0 0
0 0 1 0
0 0 0 1
1
n
e
Transformation from VCS to View Plane
3D Viewing
Using Perspective Transformation M
p
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


3D Viewing













= =

1 0 0 0
0 1
0 0 1 0
0 0 0 1
1 1
n v n u
s
e e e e
M
p*=(p
u
,p
v
,p
n
,1)M
s
M
p
q : in WCS maps to
p*=qA
wv
M
s
M
p
Transformation from VCS to View Plane
If eye is off n-axis we have another matrix
3D Viewing
View Volume
Back Plane
n=B
Front Plane
n=F
View Plane, n=0
Eye
3D Viewing
View Volume
v
v
n n
w
t
w
b
w
t
w
b
F B
F/(1-F/e
n
)
B/(1-B/e
n
)
3D Viewing
Volume Normalization Transformation
V
t
V
b
V
l
V
r
0
1
v
u
3D Viewing
Volume Normalization Transformation
F/(1-F/e
n
)
B/(1-B/e
n
)
n
o
0
n
t
1
For n
) (
) (
) (
) )( (
1 1
1
2
B F e
B e F
F B e
n B e F e
e
F
F
e
B
B
e
F
F
n
n
n
n
n
o n n
n n
n
o
t

Scaling s
n
Translation r
n
3D Viewing












= =
1
0 0 0
0 0 0
0 0 0
n v u
n
v
n
r r r
s
s
s
N
) ( / )) )( ((
) /( ) (
) /( ) (
2
F B e F e B e s
w w v v s
w w v v s
n n n n
b t b t v
r l r l u



Volume Normalization Transformation
where
) ( / ) (
) /( ) (
) /( ) (
B F e B e F r
w w w v w v r
w w w v w v r
n n n
b t b t t b v
r l r l l r u



Total Transformation: A
wv
M
s
M
p
N

You might also like