cs 417 perspective transformation - 3d s02-1 · pdf filesimple perspective transformation. e e...
TRANSCRIPT
Visual Imaging in the Electronic Age
Perspective Transformations
Lecture # 3August 29, 2017
Prof. Donald P. Greenberg
Lab This WeekTuesdays at 2:30 PM and Thursdays at 4:30 PM: Left-brainers (blue)Tuesdays at 4:30 PM and Thursdays at 2:30 PM: Right-brainers (green)Wednesdays at 4:30 PM: Surplus and/or engineering honors section
® Donald P. Greenberg - Cornell Program of Computer Graphics
Simple Perspective Transformation
e
es
e
es
e
e
e
e
e
es
e
es
SzDyy
SzDxx
S.ndow size by the wican dividefraction, nsionless to a dimeTo convert
zDy
zDxx
zy
Dy
zx
Dx
==
==
==
,
y ,
,
ss
Pinhole Camera
Note that the entire image through the pinhole is totally in focus on a single image plane.
• We have seen how a pinhole camera (or camera obscura) works
• We have also seen Brunelleschi’s experiment with his perspective panels
• Both are obviously two dimensional and exist on a planar (flat) surface
Perspective Depth
• We now know how to mathematically (and geometrically) construct the perspective image. (e.g., xs, ys)
• But how do we find the third dimension (zs)?
How a Camera Lens Works• Rays which pass through the focal point are bent
to leave the lens perpendicular to its principal axis.
How a Camera Lens Works• Rays which pass through the focal point are bent
to leave the lens perpendicular to its principal axis.
• Rays which are perpendicular to the principal axis of the lens are bent through the focal point.
e
ep
e
ep
zx
fx
zy
fy
=−
=−
,Using triangles A and A':
fzy
fy
p
pe
2−−
−=Using triangles B and B':
e
ep
e
ep z
yfyzxfx −=−=∴ ,
How a Camera Lens Works
ffz
yy
zf
yy p
e
p
ee
p 2 ,
−−=
−=
−We know that:
ep
e
p
zffz
zf
ffz 2
2 ,2
−=+=
−−∴
ep z
ffz2
2 −−=
How a Camera Lens Works
http://upload.wikimedia.org/wikipedia/en/5/5f/DoF-sym.png
® Donald P. Greenberg - Cornell Program of Computer Graphics
Mapping a Viewing Frustumto a Standard Viewbox
11ze = DXe
Frustum of vision Screen coordinate system
Ze
Ye
ze = F
Xs
Ys Zs
1
® Donald P. Greenberg - Cornell Program of Computer Graphics
Viewing Frustum - User ParametersLocation and Orientation (vectors):
Eye location of eye pointAt a point along view direction vectorUp a vector defining the Y axis on the hither plane
Shape (scalars):fov field of view angleaspect view plane aspect ratiohither perpendicular distance to hither planeyon perpendicular distance to yon plane
AtUp
Eye
aspect = width / height
hither yon
fov
3D Perspective Image(x & y coordinates in virtual image space)
e
ep z
xfx −=e
ep z
yfy −=
e
ep z
xx constant=e
ep z
yy constant=
ep z
ffz2
2 −−=
ep z
z 121 constantconstant +=
3D Perspective Image(z depth coordinate in virtual image space)