Geometry: �Coordinates & Cameras
February 13, 2018 ❖ Lecture 3
Outline
Coordinate Systems
x
Z
X
Y
Coordinate Systems
x
k
i
j
F
o
Z
X
Y
Coordinate Systems
u, v, w (sorry!)
x
w
(or n)
u
v
F
o
Z
X
Y
Coordinate Systems
x = o + xi + yj + zk
x
k
i
j
F
o
Z
X
Y
Coordinate Systems
x = o + xi + yj + zk
x
k
i
j
F
o
Z
X
Y
In Marschner: p + uu + vv + ww
3-D Transformations:� Arbitrary Change of Coordinates
YA
XA
ZA
A
x
ZB
XB
YB
B
3-D Transformations:� Arbitrary Change of Coordinates
YA
ZA
A
ZB
XB
YB
B
XA
Ax
3-D Transformations:� Arbitrary Change of Coordinates
YA
ZA
A
ZB
XB
YB
B
XA
Bx
See Fig. 6.20 in Marschner for 2-D equivalent
3-D Transformations:� Arbitrary Change of Coordinates
A
B
3-D Transformations:� Arbitrary Change of Coordinates
A
B
M transforms x from A's to B's coordinate system
3-D Transformations:� Translation-only Change of Coordinates
Location of A’s origin in
B’s coordinate system
A
B
3-D Transformations:� Arbitrary Change of Coordinates
Rotation that makes
A’s axes parallel to B’s,
creating translation-
only case
A
B
3-D Transformations:� Arbitrary Change of Coordinates
A
B
3-D Rigid Transformations
T
R
M
Rigid Transformations: Homogeneous Coordinates
Rigid Transformations: Homogeneous Coordinates
same as frame-to-canonical
matrix in Marschner 6.5
Rigid Transformations: Homogeneous Coordinates
same as frame-to-canonical
matrix in Marschner 6.5
Rigid Transformations: Homogeneous Coordinates
same as frame-to-canonical
matrix in Marschner 6.5
Controlling the camera position
from Woo et al.
glm::lookAt: What It Does
More details in Marschner, Chapter 7.1.3
glm::lookAt: How It Works
from Hill
center
C
W
glm::lookAt: Camera axes in world coords.
from Hill
center
C
W
glm::lookAt: Camera axes in world coords.
from Hill
center
C
W
glm::lookAt: Camera axes in world coords.
from Hill
center
up
C
W
up and n define a plane
which u is normal to—they
don’t have to be orthogonal
glm::lookAt: Camera axes in world coords.
from Hill
center
C
W
glm::lookAt: Camera axes in world coords.
from Hill
center
C
W
glm::lookAt: Camera axes in world coords.
from Hill
center
C
W
glm::lookAt: Camera axes in world coords.
glm::lookAt: Location
from Hill
center
origin
-eye
C
W
glm::lookAt: Location
from Hill
center
origin
-eye
C
W
glm::lookAt: Matrix
Transformations vs. Projections
Transformations
Projections
Parallel projection along direction d onto a plane
from Hill
Parallel Projections
Oblique: d in general position
relative to image plane normal n
Orthographic: d parallel to n
from Hill
The Viewing Volume
courtesy of N. Robins
Orthographic Projection
from Hill
Camera Orientation under Orthographic Projection (set by lookat)
courtesy of http://glasnost.itcarlow.ie/~powerk/GeneralGraphicsNotes/projection/orthographicprojection.html
Z
X
Y
Camera Orientation under Orthographic Projection (set by lookat)
By SharkD - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=8497328
Camera Orientation under Orthographic Projection (set by lookat)
some images courtesy of http://glasnost.itcarlow.ie/~powerk/GeneralGraphicsNotes/projection/orthographicprojection.html
SimCity 2000 (not quite isometric)
Diablo