cs 417 perspective transformation - 3d s02-1 · pdf filesimple perspective transformation. e e...

50
Visual Imaging in the Electronic Age Perspective Transformations Lecture # 3 August 29, 2017 Prof. Donald P. Greenberg

Upload: nguyendien

Post on 23-Mar-2018

214 views

Category:

Documents


1 download

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

End of Review

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)?

David Macauley, Locating the Vanishing Point

Locating the Vanishing Point

How a Camera Lens Works• Rays which pass through the focal point are bent

to leave the lens perpendicular to its principal axis.

® Donald P. Greenberg - Cornell Program of Computer Graphics

® Donald P. Greenberg - Cornell Program of Computer Graphics

Railroad Tracks in Perspective

elevation

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.

How a Camera Lens Works

f

P(xe, ye, ze)

P′(xp, yp, zp)

-zp - 2f

Ze

Xe

Ye

A

A′

B

B′

f

-yp

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

How a Camera Lens Works

Camera Film

Plane

Camera Film

Plane

http://upload.wikimedia.org/wikipedia/en/5/5f/DoF-sym.png

® Donald P. Greenberg - Cornell Program of Computer Graphics

Perspective Projections in Computer Graphics

Eye coordinate systemPlan or elevation view

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

Object Space

(One point perspective)

Image Space

(One point perspective)

Object Space

(Two point perspective)

Image Space

(Two point perspective)

Object Space

(Three point perspective)

Image Space

(Three point perspective)

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)

Equivalent Distorted Geometriesin Virtual Image Space

Distorted Geometry Model

® Donald P. Greenberg - Cornell Program of Computer Graphics

Distorted Geometry Model

® Donald P. Greenberg - Cornell Program of Computer Graphics

Uses of Perspective in Enlarging Architectural Space (3D)

Palazzo Spada

Borromini

Imss,Firenze 2004 - 3 Scenografia prospettica

Imss,Firenze 2004 - 3 Scenografia prospettica

Imss,Firenze 2004 - 3 Scenografia prospettica

Imss,Firenze 2004 - 3 Scenografia prospettica

Imss,Firenze 2004 - 3 Scenografia prospettica

Imss,Firenze 2004 - 3 Scenografia prospettica

Imss,Firenze 2004 - 3 Scenografia prospettica

Imss,Firenze 2004 - 3 Scenografia prospettica

Borromini

Palazzo Spada

Borromini

Palazzo Spada

Probe Demo

® Donald P. Greenberg - Cornell Program of Computer Graphics

End. . .

® Donald P. Greenberg - Cornell Program of Computer Graphics