Nima Kalantari
CSCE 441 - Computer Graphics
Viewing Transformations
Some slides from Ren Ng and Ravi Ramamoorthi
Model Transformation
Model from Pradeep Sen
World Coordinate
y
x
z
Local Coordinate
Z
Y
X
Outline
Camera Space
Model from Pradeep Sen
Camera
Camera Coordinate
World Coordinate
w
v
u
Z
Y
X
View Transformation
Model from Pradeep Sen
Camera
Camera Coordinate
World Coordinate
Z
Y
X
w
v
u
Construct Camera Coordinate Frame
Model from Pradeep Sen
Camera
Camera Coordinate
World Coordinate
Z
Y
X
w
v
u
Coordinate Frames
Construct Camera Coordinate Frame
Model from Pradeep Sen
Camera
Camera Coordinate
World Coordinate
Z
Y
X
w
v
u
up
a
Construct Camera Coordinate Frame
Model from Pradeep Sen
Camera
Camera Coordinate
World Coordinate
Z
Y
X
w
v
u
up
a
Construct Camera Coordinate Frame
Model from Pradeep Sen
Camera
Camera Coordinate
World Coordinate
Z
Y
X
w
v
u
up
a
View Transformation
Model from Pradeep Sen
Camera
Camera Coordinate
World Coordinate
Z
Y
X
w
v
u
Coordinate Change: 2D Example
World
Coordinate transformation
world
camera
camera to world
world to camera
Camera Control – Assignment 2
center
eye
Camera Control – Assignment 2
center
eye
Camera Control – Assignment 2
center
eye
local up (v)
a
right (u)
global up (up)
Outline
Motivation
x
z
y
+1
-1
+1
-1
-1
+1
Normalized Device
Coordinate (NDC)
x
z
y
Camera coordinate
Projection Transformation
Orthographic Projection
Orthographic Projection
Orthographic Projection
left
right
top
buttom
Orthographic Projections
In general
x
z
y
l
r
t
b
n
f
x
z
Translate
y
x
z
y
Scale
+1
-1
+1
-1
-1
+1
Normalized Device
Coordinates (NDC)
Transformation Matrix
Scale
Translation (centering)
Caveats
x
z
y
l
r
t
b
n
f
x
z
Translate
y
x
z
y
Scale
+1
-1
+1
-1
-1
+1
Normalized Device
Coordinates (NDC)
Final Result
Final Result
Projection Transformation
Perspective in Photographs
Pinhole Camera
Perspective view volume to NDC
From Angel and Shreiner, Interactive Computer Graphics
Near
Far
x
z
y
+1
-1
+1
-1
-1
+1
Normalized Device
Coordinate (NDC)
Specifying Perspective Projection
From Angel and Shreiner, Interactive Computer Graphics
Specifying Perspective Projection
Field of view
(fovy)
width
height
Aspect ratio = width / height
Specifying Perspective Projection
From Angel and Shreiner, Interactive Computer Graphics
Near
Far
Summary
Perspective view volume to NDC
From Angel and Shreiner, Interactive Computer Graphics
Near
Far
Side View of Our Screen
In Matrices
Perspective view volume to NDC
From Angel and Shreiner, Interactive Computer Graphics
Near
Far
+1
-1
-1
+1
Side View of Our Screen
fovy
+1
-1
In Matrices
Taking aspect into account
Field of view
(fovy)
width
height
Perspective view volume to NDC
From Angel and Shreiner, Interactive Computer Graphics
Near
Far
+1
-1
-1
+1
+1
-aspect
-1
+aspect
In Matrices
Perspective Projection Transform
Normalized Device Coordinates
(1, 1, 1)
(1, 1, –1)
Near Plane
Far Plane
Camera Coordinates
In Matrices
In Matrices
In Matrices
Z mapping derivation
Perspective Matrix
Perspective Matrix