Transformations: MIT EECS 6.837, Durand and Cutler
Transformations: MIT EECS 6.837, Durand and Cutler
Transformations: MIT EECS 6.837, Durand and Cutler
koi scyudits
MIT EECS 6.837, Durand and Cutler
Notes on Assignments
• Make sure you turn in a linux or windows
executable (so we can test your program)
• Don't use athena dialup
• Collaboration Policy
– Share ideas, not code
• Ask questions during office hours, or email
6.837-staff@graphics.csail.mit.edu
• Tell us how much time you spent on each
assignment
• Can be combined
• Are these operations invertible?
Yes, except scale = 0
• Preserves distances
• Preserves angles
Rigid / Euclidean
Identity
Translation
Rotation
• Preserves angles
Similitudes
Rigid / Euclidean
Identity
Translation Isotropic Scaling
Rotation
Similitudes
Linear
Rigid / Euclidean
Scaling
Identity
Translation Isotropic Scaling Reflection
Rotation
Shear
Similitudes
Linear
Rigid / Euclidean
Scaling
Identity
Translation Isotropic Scaling Reflection
Rotation
Shear
Similitudes
Linear
Rigid / Euclidean
Scaling
Identity
Translation Isotropic Scaling Reflection
Rotation
Shear
Similitudes
Linear
Rigid / Euclidean
Scaling
Identity
Translation Isotropic Scaling Reflection
Rotation
Shear
Perspective
MIT EECS 6.837, Durand and Cutler
Perspective Projection
x' = ax + by + c
y' = dx + ey + f
x' a b x c
= +
y' d e y f
p' = Mp + t
MIT EECS 6.837, Durand and Cutler
Homogeneous Coordinates
• Add an extra dimension
• in 2D, we use 3 x 3 matrices
• In 3D, we use 4 x 4 matrices
• Each point has an extra value, w
x' a b c d x
y' e f g h y
=
z' i j k l z
w' m n o p w
p' = Mp
MIT EECS 6.837, Durand and Cutler
Homogeneous Coordinates
• Most of the time w = 1, and we can ignore it
x' a b c d x
y' e f g h y
=
z' i j k l z
1 0 0 0 1 1
(0, 0, 1) = (0, 0, 2) = … w = 1
(7, 1, 1) = (14, 2, 2) = …
(4, 5, 1) = (8, 10, 2) = … w=2
MIT EECS 6.837, Durand and Cutler
Translate (tx, ty, tz) Translate(c,0,0)
y
x' 1 0 0 tx x
y' 0 1 0 ty y
=
z' 0 0 1 tz z
10 0 0 0 1 1
• Isotropic (uniform)
p
scaling: sx = sy = sz q'
q
x
x' sx 0 0 0 x
y' 0 sy 0 0 y
=
z' 0 0 sz 0 z
1 0 0 0 1 1
x
z
y
• Find: v
p u
p = (u,v,n)
n x
z
x.u
z
x = (x . u) u + (x . v) v + (x . n) n
y = (y . u) u + (y . v) v + (y . n) n
z = (z . u) u + (z . v) v + (z . n) n
p = x [ (x . u) u + (x . v) v + (x . n) n ] +
y [ (y . u) u + (y . v) v + (y . n) n ] +
z [ (z . u) u + (z . v) v + (z . n) n ]
Rewrite:
p = [ x (x . u) + y (y . u) + z (z . u) ] u +
[ x (x . v) + y (y . v) + z (z . v) ] v +
[ x (x . n) + y (y . n) + z (z . n) ] n
u = x (x . u) + y (y . u) + z (z . u)
v = x (x . v) + y (y . v) + z (z . v)
n = x (x . n) + y (y . n) + z (z . n)
In matrix form:
where:
u ux uy uz x ux = x . u
v = vx vy vz y uy = y . u
n nx ny nz z etc.
x xu x v xn u u x = x . u = u . x = xu
y = yu y v yn v
z zu zv zn n
M = M
-1 T
Adding Transformations
to the Ray Caster
(Assignment 2)