Lecture14a Viewing3D Projections I
Lecture14a Viewing3D Projections I
ModelView
ModelViewMatrix
Matrix
Viewing
Coordinates
Projection
ProjectionMatrix
Matrix
Clip
Coordinates
Clipping
Clipping
Viewport
ViewportTransformation
Transformation
Window Coordinates
Viewing Coordinate System
zw
world
xw yw
Tractor
System Viewer
System
yv
Front- xv
Wheel
System P0
zv
ne
pl a
i n g
i ew
V
Specifying the Viewing Coordinates
• Viewing Coordinates system, [xv, yv, zv],
describes 3D objects with respect to a viewer
zw
v yv
P
xv
N
P0
zv
yw
xw la ne
g p
w in
V ie
• P0=(x0,y0,z0) is the point where a camera is located
• P is a point to look-at
• N=(P0-P)/|P0-P| is the view-plane normal vector
• V=zw is the view up vector, whose projection onto
the view-plane is directed up
Viewing Coordinate System
V × N
zv = N ; xv = ; yv = zv × xv
V × N
• The transformation M, from world-coordinate into
viewing-coordinates is:
x 1
v x 2
v x 3
v 0 1 0 0 − x 0
y 1
y 2
y 3
0 0 1 0 − y
M = v v v 0 = R ⋅T
z 1
z 2
z 3
0 0 0 1 − z 0
v v v
0 0 0 1 0 0 0 1
Perspective Projection
Parallel Projection
• Projectors are all parallel
• Orthographic: Projectors are perpendicular
to the projection plane
• Oblique: Projectors are not necessarily
perpendicular to the projection plane
Orthographic Oblique
Orthographic Projection
Since the viewing plane is aligned with (xv,yv),
orthographic projection is performed by:
x p xv 1 0 0 0 x v
y p
y 0
= v = 1 0 0
y v
0 0 0 0 0 0 zv
1 1 0 0 0 1 1
(x,y,z) (x,y)
yv
xv
P0
zv
Orthographic Projection
• Lengths and angles of faces parallel to the
viewing planes are preserved
• Problem: 3D nature of projected objects is
difficult to deduce Top
View
Fro i e w
nt eV
vi e
w Sid
Oblique Projection
• Projectors are not perpendicular to the
viewing plane
• Angles and lengths are preserved for faces
parallel to the plane of projection
• Preserves 3D nature of an object
yv (xp,yp)
xv
(x,y,z)
(x,y)
Oblique Projection
•Two types of oblique projections are
commonly used:
– Cavalier: α=45ο =tan−1(1)
– Cabinet: α=tan-1(2) ≈63.4ο
yv
(xp,yp)
α
b
a xv
(x,y,z) φ
(x,y,1)
(x,y)
Oblique Projection
x p 1 0 a cos φ 0 xv x v + z v a cos φ
y p 0 1 a sin φ 0 yv y + z a sin φ
= = v v
0 0 0 0 0 zv 0
1 0 0 0 1 1 1
yv
1/a=tan(α)
z/b= 1/a (xp,yp)
b=za
α
b
xp=z⋅a⋅cos(φ)
a xv
yp=z⋅a⋅sin(φ) (x,y,z) φ
(x,y,1)
(x,y)
Oblique Projection
1 1
1 1
1 1
φ=45o φ=30o
0.5 1 0.5
1
1 1
φ=45o φ=30o
z
Perspective Projection
Vanishing Points
• There are infinitely many general vanishing
points
• There can be up to three principal vanishing
points (axis vanishing points)
• Perspective projections are categorized by
the number of principal vanishing points, equal
to the number of principal axes intersected by
the viewing plane
• Most commonly used: one-point and two-
points perspective
Vanishing Points
y
x axis z axis
vanishing point vanishing point
Two points
perspective projection
Perspective Projection
(x,y,z)
(xp,yp,0)
d y
center of x
projection x (x,y,z)
z xp
d z
• Using similar triangles it follows:
xp x yp y
= ; =
d z+d d z+d
d ⋅x d⋅y
xp = ; yp = ; zp = 0
z+d z+d
Perspective Projection
Thus, a perspective projection matrix is defined as:
1 0 0 0
0 1 0 0
M per = 0 0 0 0
1
0 0 1
d
1 0 0 0 x x
0 1 0 0 y
y
M per P = 0 0 0 0 = 0
z
1 z + d
0 0 1
1
d d
d ⋅x d ⋅y
xp = ; y p = ; z p = 0
z + d z + d
Perspective Projection
• Mper is singular (|Mper|=0), thus Mper is a many to
one mapping (for example: MperP=Mper2P)
• Points on the viewing plane (z=0) do not change
• The homogeneous coordinates of a point at infinity
directed to (Ux,Uy,Uz) are (Ux,Uy,Uz,0). Thus, The
vanishing point of parallel lines directed to (Ux,Uy,Uz)
is at [dUx/Uz, dUy/Uz]
Center of Projection z
Projection plane
Moving the Center of Projection
Center of Projection z
Projection plane
Moving the Projection Plane
Center of Projection z
Projection plane
Projections
Planar geometric
projections
Parallel Perspective