Geometry: �Coordinates & Cameras
Instructor: Christopher Rasmussen (cer@cis.udel.edu)
February 15, 2022 ❖ 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
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
Blender: camera pose + object, right-handed coordinates. Origin of camera coordinate system C at tip of pyramid, note "up" arrow. World coordinates W coincide with cube object centroid (aka "model" coordinates M)
Similar view in Unity, left-handed coordinates. Here camera axes are explicit and world coordinates are not same as model coordinates.
RGB axis colors correspond to XYZ ordering
Transformations in Blender
Transformations in OpenGL
Controlling the camera position in OpenGL
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 ũ 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
center
from Hill
origin
C
W
glm::lookAt: Location
center
from Hill
origin
C
W
eye
eye is camera origin in world coordinates -- aren't they just the reverse of each other?
glm::lookAt: Location
center
from Hill
origin
C
W
-eye
eye is camera origin in world coordinates -- aren't they just the reverse of each other?
glm::lookAt: Location
from Hill
origin
-eye
C
W
glm::lookAt: Matrix
V =
Transformations vs. Projections in CG
Transformations in CG
Projections in CG
The Viewing Volume
courtesy of N. Robins
Pyramid-shaped viewing volumes are characteristic of perspective projection -- more on Thursday