CSCE 441 Lecture 9

From Notes
Jump to navigation Jump to search

« previous | Monday, February 3, 2014 | next »


Affine Transformations as Matrices

This material will be on the midterm!
[p^xp^y1]=[M11M12txM21M22ty001][p→xp→y0]


Goal is to construct matrix such that a 2×2 matrix is multiplied by our input vector and a 2-coordinate vector t that is added to our input vector.


Dot Product

v→⋅w→=v→Tw→=[v→xv→y][w→xw→y]


2D Cross Product

Multiply by matrix ⊥=[0−110]


Translation

Our 2 × 2 matrix M is just the identity matrix, and our t-coordinates become our translation values:

[It01][p→1]=[p→+t1]


In expanded notation:

[10tx01ty001][p→xp→y1]=[p→x+txp→y+ty1]


Uniform Scaling

[αI(1−α)o01][p→1]=[αp→+(1−α)o1]


Non-Uniform Scaling

[I+(α−1)v→v→T(1−α)v→v→To01][p→1]


Rotation

[Io01][cos⁡θI+sin⁡θ⊥001][I−o01][p→1]


Shear

[I+αv→(v→⊥)T−αv→(v→⊥)To01][p→1]


Finding Affine Transformations

Image of 3 points determines unique affine transformation

M[p→q→r→111]=[p^q^r^111]

Hence

M=[p^q^r^111][p→q→r→111]−1


Composing Transformations

Multiply all of the matrices together


Fractals and Iterated Affine Transformations

Fractals are recursion made visible:

A self-similar shape created from a set of contractive transformations