CS488 - Introduction to Computer Graphics - Lecture 6

Review

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

Windows

On the view plane

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.

• P = x i + y j + z k + O = x' i' + y' j' + z' k' + O'
• ( x, y, z ) and ( x', y', z' ) are the two sets of coordinates.
• ( i, j, k, O ) and ( i', j', k', O' ) are the two frames.
• If any three of these are known we can find the fourth.

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?

• Tj = Tsn ... Ts2 Ts1
• 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?

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

• Inverse of transforming a frame
• P = F pF = F' pF' = F Tinv T pF
• pF' = T pF are the transformed coordinates
• F' = F Tinv is the transformed frame

Transforming a Frame

• Inverse of transforming a point

Rigid Transformations

These three transformations - 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 should understand this geometrically.

Translation

Add a vector to a point

• Ta( P )
• pF' = pF + a
```/          \   /   \     /        \
| 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    |
\          /   \   /     \        /```
• To invert change the sign of a. Check for yourself.

No effect on vector. Check for yourself.

Rotation

To specify a rotation you need

• an axis of rotation
• an angle of rotation
• Ra, thetaa( P )

Three basic rotations encompass all rotations

• geometrical demonstration

Reflection

To specify a reflection you need

• a plane across which the reflection occurs

Non-rigid transformations

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

• Rigid body transformations.
• They don't change the size or shape of the object.

Other affine transformations don't have this property