CS488 - Introduction to Computer Graphics - Lecture 7
Affine Transformations in Practice
Another Take on Affine Transformations
`The longest journey starts with but a single step.' What does this
mean?
- Tx = Tsn ... Ts2 Ts1 x
- Any transformation can be constructed from a sequence of more
elementary transformations.
Is there a small set of simple transformations from which all
transformations can be constructed?
- Yes!!
- Should we thank heaven for making it so?
- Or geometers for discovering and exploring it?
If you are thinking about transformations as a group, this is something
like the generators of the group.
- strictly speaking, a superset of the generators
Example
Translation is simple; rotation about a basis vector is simple. But
rotation about an arbitrary axis is complex.
Construct rotation about an aribitrary axis from translation and rotation
about a basis vector.
- Translate the axis of rotation so that it passes through the
origin.
- Rotate the axis of rotation to coincide with the z-axis.
- First about the x-axis until it lies in the yz-plane
- Then about the y-axis until it lise along the z-axis
- Rotate by the specified angle.
- Undo the axis rotation.
- Undo the translation.
Notice the structure, Tinv S T, which occurs over and over again.
Specific Transformations You should Know
Transforming a the Coordinates of a Point
Inverse of transforming a frame
- P = F p
- Maybe F is a 4D vector of
vectors & points
- Maybe F is a 4x4 matrix
- p' = T p
- T is the matrix that finds
the coordinates of P in the
new frame.
- We want to find out what T
is.
- P = F' p' = F' T p = F' T F^-1 P
- Therefore, F' T F^-1 = I, and
- T = F'^-1 F, or
- p' = F'^-1 F p
Transforming a Frame
Inverse of transforming a point
- F' = S F
- S is the matrix that
transforms the coordinate frame
- We want to know what S is
given P = F p = F' p'
- P = F' p' = S F p'
- Therefore F' = S F, and
Rigid Transformations
Four transformations - identity, translation, rotation, reflection - have
a special property
- They don't change the size or shape of the object.
All rigid transformations can be constructed from them.
- You must understand them both geometrically and algebraically.
Translation
Add a vector to a point, Ta
- P' = P + a = Ta
P
- P' - P = TaP - P = a
- Dot with i
- Txx Px + Txy Py + Txz Pz + Txo - Px = ax
- We get four equations
- Txx - 1 = 0
- Txy = 0
- Txz = 0
- Txo = ax
- Do it with j & k
- Finally, Tox Px + Toy Py + Toz Pz + Too = 1
What is the inverse?
What matrix transforms the frame?
What is the effect of Ta on a
vector?
Reflection
Reflect in a plane, Fab
For example, choose the yz plane. Then
- Px' = -Px; Py' = Py; Pz'=Pz
- P' = Fjk P => P' - P = Fjk
P - P
- P' - P = -2 px i = Fjk
P - P
- Dot with i
- -2Px = Fxx Px + Fxy Py + Fxz Pz + Fxo - Px
- Four equations
- Fxx = -1
- Fxy = 0
- Fxz = 0
- Fxo = 0
- etc
What is the inverse?
What matrix transforms the frame?
What is the effect of Fab on a
vector?
Rotation
Return to: