Transformations in Affine Spaces

1. Assignment 0
2. Assignment 1, office hours

Affine Spaces (review)

Space means closed under ...

1. Vector space
• Set of vectors
• Closed under vector addition (+1), scalar multiplication
• Bases
• Infinite number
• All have the same cardinality
• Know, from first year, how to transform one basis to another

Plus, a set of points

• Closed under point/vector addition (+2)
• Bases must add a point, any point
• Transform one basis to another
• Add a vector to the point
• And use vector space transforms

Special properties

1. Affine combinations
2. Affine transformations: linear under
• vector/vector addition: T(v1 +1 v2) = T(v1) +1 T(v2)
• point/vector addition: T(P +2 v) = T(P) +2 Y(v)

form groups. (Thanks, Felix Klein)

Euclidean Space

An affine space plus a metric, d(P1, P2), that has translational invariance

• Metric is symmetric by definition
• also non-negative and obeying the triangle inequality.
• Translational symmetry means: d(P1, P2) = d(P1 +2 v, P2 +2 v).

The familiar dot product (defined on vectors, Why?) is your baby.

• d(P1, P2) = ( P1 -2 P2 ) /dot ( P1 -2 P2 ) = | P1 -2 P2 |
• This gives you what Euclid was able to do with a compass, and more.

The dot product also defines angles between vectors.

• cos(s) = v1 \dot v2 / (|v1| |v2|),
• s is the angle between v1 and v2.
• This is part of the more' we got than compass.

Cartesian Space

A Euclidean space plus a (usually orthonormal) frame.

• The frame is ( i, j, k, O ).
• ( i, j, k ) is a set of basis vectors that normally has two properties
1. orthogonality: i \dot j = j \dot k = k \dot i = 0.
2. normalization: |i| = |j| = |k| = 1.

Using the frame (often called standard' or distinguished' ) we can write uniquely

• any vector as v =1 ( x, y, z, 0 ) \dot ( i, j, k, O ) =1 x *1 i +1 y *1 j +1 z *1 k, and
• any point as P =2 ( x, y, z, 1 ) \dot ( i, j, k, O ) =2 ( x *1 i +1 y *1 j +1 z *1 k ) +2 O
• ( x, y, z, 1 ) and ( x, y, z, 0 ) are called the coordinates' of the point or vector.
• Note that coordinates are defined wrt a frame: without a specific frame they are meaningless.

Affine Transformations in Cartesian Spaces

The general idea is that we apply a transformation to a point to position it.

• P -> T P

There are two ways to see this process

One Point, Two Frames

1. P = x i + y j + z k + O; P' = x' i' + y' j' + z' k' + O'
2. P' = P
3. Express the second frame in terms of the first.

i = T(i') = a00i' + a01j' + a02k', etc.

O = T(O') = a30 i' + a31 j' + a32 k' + O'.

4. Then collect terms and solve for x', y', z'.

x' = x a00 + y a10 + x a20 + a30, etc

5. Thus

(x', y', z', 1) = U(x,y,z,1) where U is the transpose of T

This tells you the coordinates the same point in a different frame.

Two Points, One Frame

1. P = x i + y j + z k + O; P' = x' i' + y' j' + z' k' + O'
2. P' = T'(P)
3. Express the second frame in terms of the first.

i' = T'(i) = b00 i + b01 j + b02 k, etc.

O' = T'(O) = b30 i + b31 j + b32 k + O.

4. Then collect terms and solve for x', y', z'.
5. Thus,

(x, y, z, 1) = U'(x, y, z, 1), where U' is the transpose of T'

This tells you the coordinates the transformed point in the original frame.

It's Pretty Easy to See that

1. T' is the inverse of T: i' = T(i) = T(T'(i')), etc.

U' is the inverse of U

U' = T, T' = U

2. a00 = i \dot i', a01 = i \dot j', etc.: Take the dot product with i, j, k of equation 3.

Example: Viewport Transformation

Viewplane frame

1. Origin, O, at the centre
2. i increasing to the right (measured in pixels)
3. j increasing up (measured in pixels)

Display frame

1. Origin, O', in the upper left corner
2. i' increasing to the right (measured in pixels)
3. j' increasing down (measured in pixels)

We know where a point in in the viewplane coordinates, and we want to display it, so we want to know its coordinates in the display frame: i.e. one point, two frames.

1. O' = O + (height/2) * i +(width/2) * j
2. i = i'
3. j = -j'
4. 1 0 0 1 0 h/2

T = 0 -1 0 T' = 0 -1 w/2

h/2 w/2 1 0 0 1

Exercise for the reader: How would this change if the viewplane frame was measured in centimetres?

View Transformations

1. Several objects positioned in the world
• Frames view
1. Each object has its own frame, in terms of which its points have coordinates.
2. Express all object coordinates in a common frame, the modelling frame.
3. Express the modelling frame in terms of the world frame.
4. Get coordinates of each object in the world frame.
• Points view
1. Each object starts at the origin of the world frame in a standard orientation, with point coordinates in the world frame.
2. Move the object to the correct position and orientation by transforming its coordinates.
• The two views give exactly the same result, with slightly different mathematics, which will be explained later.
2. Viewer's eye looks at the world. Possibilities
• Put the eye in the world frame.
• Do high school geometry.
• What a drag!
• Associate a frame, the view frame, with the viewer.
• Find object coordinates in the view frame.
• Drop a coordinate, because you defined the view frame cleverly.

What happened?

1. Point Po in object coordinates.
2. Transform Po by T1 to get it into world coordinates: Pw = T1( Po )
3. Transform Pw by V to get it into view coordinates: Pv = V( Pw ) = V( T1( Po ) ) = V T1 Po.

To move the point transform it again.

1. Pw = T2 T1 Po
2. Pv = V T2 T1 Po