Linear and Affine Transformations
Coordinate Systems
Recall
A transformation T is linear if
•
•
Recall
A transformation T is linear if
•
•
Every linear transformation can be
represented as matrix
Linear Transformation Examples
Uniform Scaling
Non-uniform Scaling
Rotations
Reflections
Orthogonal Projections
…
Translations?
Problem with Translation
Translation by not linear!
Would like a unified framework for
handling all transformations…
Homogeneous Coordinates
Main idea: add a dummy 4th dimension
• points:
• vectors:
In Homogeneous Coordinates
In Homogeneous Coordinates
In Homogeneous Coordinates
In Homogeneous Coordinates
Homogeneous Coordinates
Main idea: add a dummy 4th dimension
• points:
• vectors:
Now translation is matrix multiplication!
4 x 4 matrix transformations called affine
Linear Transformation Zoo
Translation:
Linear Transformation Zoo
Translation:
Linear Transformation Zoo
Rotation:
Linear Transformation Zoo
Rotation:
Linear Transformation Zoo
Rotation:
what about in
homogeneous coordinates?
Linear Transformation Zoo
Rotation:
Linear Transformation Zoo
Rotation:
Linear Transformation Zoo
Uniform scaling:
Linear Transformation Zoo
Uniform scaling:
Linear Transformation Zoo
Scaling:
What About Non-Axis-Aligned?
What About Non-Axis-Aligned?
compose transformations!
What About Non-Axis-Aligned?
compose transformations!
Linear Transformation Zoo
Reflection:
Linear Transformation Zoo
Reflection:
axis to reflect
Linear Transformation Zoo
Reflection:
Linear Transformation Zoo
Shear:
Linear Transformation Zoo
Shear:
Linear Transformation Zoo
Shear:
shear y-axis
in x-axis direction
Linear Transformation Zoo
Shear:
Combining Transformations
matrix multiplication does not commute
Example: Rotate About Point
Example: Rotate About Point
Transforming Normals
The problem:
Transforming Normals
The problem:
Transforming Normals
The problem:
Points and vectors:
Normals:
What is a Coordinate System?
1. an origin
2. a frame of vectors spanning space
What is a Coordinate System?
1. an origin
2. a frame of vectors spanning space
• usually orthonormal
• usually right-handed
What is a Coordinate System?
1. an origin
2. a frame of vectors spanning space
• usually orthonormal
• usually right-handed
How represented?
What is a Coordinate System?
1. an origin
2. a frame of vectors spanning space
• usually orthonormal
• usually right-handed
How represented?
• in other coordinates…
(turtles all the way down?)
Cartesian “World” Coordinates
Canonical “root” coordinate system
Usually y points “up,” x
and z “horizontal”
But this is arbitrary
Transforming Coordinate Systems
Can define coordinate system in terms of
world coordinates
Transforming Coordinate Systems
Can define coordinate system in terms of
world coordinates
Given in world coords
Transforming Coordinate Systems
Can define coordinate system in terms of
world coordinates
Given in world coords
Change of Coordinates Matrix
Maps from local to world coordinates
Change of Coordinates Matrix
Maps from local to world coordinates
How to map back?
More Coordinates Systems
world
More Coordinates Systems
world
Coordinate Systems in Graphics
world
camera
Coordinate Systems in Graphics
world
view matrix (also called “look at”)
camera
Building the View Matrix
Three axes: tangent, up, look
Building the View Matrix
Three axes: tangent, up, look
Note: camera looks down negative look
direction for extra confusion
Building the View Matrix
Three axes: tangent, up, look
Note: camera looks down negative look
direction for extra confusion
tangent
-look
eye
up
Building the View Matrix
Three axes: tangent, up, look
Note: camera looks down negative look
direction for extra confusion
tangent
-look
eye
up
Building the View Matrix
R
tangent
-R eye
up
-look
tangent
-look
eye
up
Coordinate Systems in Graphics
world
view matrix
object
camera
Why Use Object Coordinates?
Why Use Object Coordinates?
Easier to work with / animate
Why Use Object Coordinates?
Easier to work with / animate
Instancing
Coordinate Systems in Graphics
model world
matrix
view matrix
object
camera
Transformations
Every transformation creates child
coordinate system
Two Interpretations of
Backwards: transforms applied right to
left in original coordinate system
Two Interpretations of
Forwards: transforms applied left to
right in new coordinate systems
Two Interpretations of
Same answer either way, but both
interpretations useful
Scene Graph
Represents hierarchy of transformations
Assignment 3: bones in
character body