Beruflich Dokumente
Kultur Dokumente
Outline
Assignment 0 Recap Intro to Transformations Classes of Transformations Representing Transformations Combining Transformations Change of Orthonormal Basis
emmav
(Courtesy of Emily Vincent. Used with permission.)
psoto
(Courtesy of Paul Soto. Used with permission.)
scyudits
MIT EECS 6.837, Durand and Cutler
(Courtesy of Sophia Yuditskaya. Used with permission.)
Notes on Assignments
Make sure you turn in a linux or windows executable (so we can test your program) Collaboration Policy
Share ideas, not code
Outline
Assignment 0 Recap Intro to Transformations Classes of Transformations Representing Transformations Combining Transformations Change of Orthonormal Basis
What is a Transformation?
Maps points (x, y) in one coordinate system to points (x', y') in another coordinate system x' = ax + by + c y' = dx + ey + f For example, IFS:
World space
common to all objects
z o
y x
EYE
Screen space
indexed according to hardware attributes
((Courtesy
Simple Transformations
Outline
Assignment 0 Recap Intro to Transformations Classes of Transformations
Rigid Body / Euclidean Transforms Similitudes / Similarity Transforms Linear Affine Projective
Rigid / Euclidean
Translation Identity Rotation
Linear Transformations
Linear Transformations
L(p + q) = L(p) + L(q) L(ap) = a L(p)
Similitudes Linear Rigid / Euclidean
Translation Identity Rotation Scaling Isotropic Scaling Reflection Shear
Affine Transformations
preserves parallel lines
Affine Similitudes Linear Rigid / Euclidean
Translation Identity Rotation Scaling Isotropic Scaling Reflection Shear
Projective Transformations
preserves lines
Projective Affine Similitudes Linear Rigid / Euclidean
Translation Identity Rotation Scaling Isotropic Scaling Reflection Shear
Perspective
Perspective Projection
Outline
Assignment 0 Recap Intro to Transformations Classes of Transformations Representing Transformations Combining Transformations Change of Orthonormal Basis
p' =
Mp + t
Homogeneous Coordinates
Add an extra dimension
in 2D, we use 3 x 3 matrices In 3D, we use 4 x 4 matrices
p' =
Mp
MIT EECS 6.837, Durand and Cutler
Homogeneous Coordinates
Most of the time w = 1, and we can ignore it x' y' z' 1 a e i 0 b f j 0 c g k 0 d h l 1 x y z 1
Homogeneous Visualization
Divide by w to normalize (homogenize) W = 0? Point at infinity (direction)
w=2
Translate(c,0,0)
p' x
1 0 0 0
0 1 0 0
0 0 1 0
tx ty tz 1
x y z 1
Scale(s,s,s)
p' p q' q x
sx 0 = 0 0
0 sy 0 0
0 0 sz 0
0 0 0 1
x y z 1
Rotation
y
ZRotate()
p'
About z axis
p x
0 0 1 0
0 0 0 1
x y z 1
Rotation
About x axis: x' y' z' 1 x' y' z' 1 = 0 0 1 0 cos -sin 0 sin cos 0 0 0 cos 0 -sin 0 0 1 1 0 sin 0 cos 0 0 0 0 1 0 0 0 1 x y z 1 x y z 1
About y axis:
Rotation
About (kx, ky, kz), a unit vector on an arbitrary axis (Rodrigues Formula)
z
Rotate(k, ) k
x
kxkx(1-c)+c kzkx(1-c)-kzs kxkz(1-c)+kys x' kykx(1-c)+kzs kzkx(1-c)+c kykz(1-c)-kxs y' = kzkx(1-c)-kys kzkx(1-c)-kxs kzkz(1-c)+c z' 0 0 0 1
where c = cos & s = sin
MIT EECS 6.837, Durand and Cutler
0 0 0 1
x y z 1
Outline
Assignment 0 Recap Intro to Transformations Classes of Transformations Representing Transformations Combining Transformations Change of Orthonormal Basis
2 0 3 0 2 1 0 0 1
Non-commutative Composition
Scale then Translate: p' = T ( S p ) = TS p
(1,1) (0,0) Scale(2,2) (0,0) (2,2) Translate(3,1) (5,3) (3,1)
Non-commutative Composition
Scale then Translate: p' = T ( S p ) = TS p TS =
1 0 3 0 1 1 0 0 1 2 0 0 0 2 0 0 0 1 2 0 3 0 2 1 0 0 1
2 0 6 0 2 2 0 0 1
Outline
Assignment 0 Recap Intro to Transformations Classes of Transformations Representing Transformations Combining Transformations Change of Orthonormal Basis
Find:
p = (u,v,n)
y v p n z
MIT EECS 6.837, Durand and Cutler
u x
x y z
= (x . u) u + (x . v) v + = (y . u) u + (y . v) v + = (z . u) u + (z . v) v +
MIT EECS 6.837, Durand and Cutler
(x . n) n (y . n) n (z . n) n
(x . n) n ] + (y . n) n ] + (z . n) n ]
(x . n) n ] + (y . n) n ] + (z . n) n ]
z (z . u) ] u + z (z . v) ] v + z (z . n) ] n
z (z . u) ] u + z (z . v) ] v + z (z . n) ] n
z (z . u) z (z . v) z (z . n)
z (z . u) z (z . v) z (z . n)
M-1 = MT
Next Time: