Projections
Projections
Projections
Reading
Angel. Chapter 5
Optional
David F. Rogers and J. Alan Adams, Mathematical Elements for Computer
Graphics, Second edition, McGraw-Hill, New York, 1990, Chapter 3.
The 3D synthetic camera model
In 3D, we map points from 3-space to the projection plane (PP) along
projectors emanating from the center of projection (COP).
PP
COP
⎡ x ⎤
⎡ x '⎤ ⎡ 1 0 0 0 ⎤ ⎢ ⎥
⎢ y '⎥ = ⎢0 1 0 0 ⎥ ⎢ y ⎥
⎢ ⎥ ⎢ ⎥ ⎢ z ⎥
⎢⎣1 ⎥⎦ ⎢⎣0 0 0 1⎥⎦ ⎢ ⎥
⎣1 ⎦
w Eye
• Acts as the COP
• Placed at the origin
• Looks down the z-axis
w Screen
• Lies in the PP
• Perpendicular to z-axis
• At distance d from the eye
• Centered on z-axis, with radius s
x (x,y,z)
xʹ′
Using similar triangles gives:
z
d
Eye space è screen space, cont.
We can write this transformation in matrix form:
⎡ X ⎤ ⎡1 0 0 0 ⎤ ⎡ x ⎤ ⎡ x ⎤
⎢ Y ⎥ ⎢0 1 0 0 ⎥ ⎢ y ⎥ ⎢ y ⎥
⎢ ⎥ = MP = ⎢ ⎥ ⎢ ⎥ = ⎢ ⎥
⎢ Z ⎥ ⎢0 0 1 0 ⎥ ⎢ z ⎥ ⎢ z ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
W
⎣ ⎦ ⎣ 0 0 1/ d 0 1
⎦ ⎣ ⎦ ⎣ z / d ⎦
Perspective divide:
⎡ x ⎤
⎡ X / W ⎤ ⎢ z / d ⎥
⎢ Y / W ⎥ ⎢ y ⎥
⎢ ⎥ = ⎢ ⎥
⎢ Z / W ⎥ ⎢ z / d ⎥
⎢ ⎥ ⎢ d ⎥
⎣W / W ⎦ ⎢ ⎥
⎢⎣ 1 ⎥⎦
Projective Normalization
After perspective transformation and perspective divide, we
apply parallel projection (drop the z) to get a 2D image.
Perspective depth
Q: What did our perspective projection do to z?
⎡ p x ⎤ ⎡v x ⎤
⎢ p ⎥ ⎢v ⎥
y y
l = p + tv = ⎢ ⎥ + t ⎢ ⎥
⎢ p z ⎥ ⎢ v z ⎥
⎢ ⎥ ⎢ ⎥
⎣ 1 ⎦ ⎣ 0 ⎦
After perspective transformation we get:
⎡ x ' ⎤ ⎡ p x + tv x ⎤
⎢ y ' ⎥ = ⎢ p + tv ⎥
⎢ ⎥ ⎢ y y ⎥
⎢⎣w '⎥⎦ ⎢⎣ −( p z + tv z )/ d ⎥⎦
Vanishing points (cont'd)
⎡ px + tvx ⎤
Dividing by w: ⎢ − p d ⎥
z + tvz
⎡ ⎤x ' ⎢ ⎥
⎢ y ' ⎥ = ⎢ − p y + tv y ⎥
d ⎥
⎢ ⎥ ⎢ p + tvz ⎥
z
⎢⎣ w '⎥⎦ ⎢
⎢ 1 ⎥ ⎡ vx ⎤
⎢
⎢⎣
⎥
⎥⎦ ⎢ − v d ⎥
⎢ z ⎥
Letting t go to infinity: ⎡ ⎤x '
⎢ ⎥ ⎢ v y ⎥
limt →∞ ⎢ y ' ⎥ = ⎢ − d ⎥
⎢ vz ⎥
⎢⎣ w '⎥⎦
We get a point! ⎢ 1 ⎥
⎢ ⎥
What happens to the line l = q + tv? ⎢⎣ ⎥⎦
Each set of parallel lines intersect at a vanishing point on the PP.