CS488 - Introduction to Computer Graphics - Lecture 6

Comments and Questions


Review

  1. Cartesian spaces.
  2. Affine combinations.
  3. View frame warning.

Windows

On the view plane

Viewports

On the device

Normalized Device Coordinates

For the device obviously


Matrix Representations of Affine Transformations

Write a general point in terms of its coordinates in two different orthonormal frames.

Example. Find ( x', y', z' )

  1. x' i' + y' j' + z' k' = x i + y j + z k + (O - O')

    Notice that this is a vector equation. 0 = 0 in the fourth coordinate comes for free!

  2. Then, taking the dot product with i': x' = x (i . i') + y (j . i') + z (k . i') + (O - O') . i'

    This is an ordinary linear algebraic equation.

    There are two other equations like this one, produced by j' and k'.

    See how nice it is to have an orthonormal frame!

  3. Write the three algebraic equations together as a matrix multiplication.
    /                          \ /   \   /    \
    | i.i' j.i' k.i' (O-O').i' | | x |   | x' |
    | i.j' j.j' k.j' (O-O').j' | | y | = | y' |
    | i.k' j.k' k.k' (O-O').k' | | z |   | z' |
    \                          / \   /   \    /
  4. What about the fourth row of the matrix?

    Points have the fourth coordinate 1, vectors 0.

    Regardless of the coordinates points should stay points, vectors vectors.

    Only the row ( 0, 0, 0, 1 ) makes it happen.

This method works fine when we know the frames in terms of each other - or in terms of another frame - but not when we want to derive the matrix from a geometrical manipulation.


Another Take on Affine Transformations

`The longest journey starts with but a single step.' What does this mean?

Is there a small set of simple transformations from which all transformations can be constructed?

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.

  1. Translate the axis of rotation so that it passes through the origin.
  2. Rotate the axis of rotation - possibly twice (Why?) - to make it lie along a coordinate axis.
  3. Rotate by the specified angle.
  4. Invert the axis rotation.
  5. Invert the translation.

Specific Matrices You should Know

Transforming a the Coordinates of a Point

Transforming a Frame

Rigid Transformations

These three transformations - translation, rotation, reflection - have a special property

All rigid transformations can be constructed from them.

Translation

Add a vector to a point

/          \   /   \     /        \
| 1 0 0 ax |   | x |     | x + ax |
| 0 1 0 ay |   | y |  =  | y + ay |
| 0 0 1 az |   | z |     | z + az |
| 0 0 0 1  |   | 1 |     |   1    |
\          /   \   /     \        /

No effect on vector. Check for yourself.

Rotation

To specify a rotation you need

Three basic rotations encompass all rotations

Reflection

To specify a reflection you need

Non-rigid transformations

These three transformations - translation, rotation, reflection - have a special property

Other affine transformations don't have this property

Scaling


Return to: