CS488 - Introduction to Computer Graphics - Lecture 6

Transformations in Affine Spaces

Comments and Questions

  1. Assignment 0
  2. Assignment 1, office hours

Affine Spaces (review)

Space means closed under ...

  1. Vector space

    Plus, a set of points

Special properties

  1. Affine combinations
  2. Affine transformations: linear under

    form groups. (Thanks, Felix Klein)


Euclidean Space

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

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

The dot product also defines angles between vectors.


Cartesian Space

A Euclidean space plus a (usually orthonormal) frame.

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


Affine Transformations in Cartesian Spaces

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

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

Return to the rendering pipeline.

  1. Several objects positioned in the world
  2. Viewer's eye looks at the world. Possibilities

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

Return to: