2-D Transformations

Tom Kelliher, CS 320

Apr. 19, 2000

Administrivia

Announcements

Friday is lab day.

Assignment

Read 4.8,9. Questions on cube.c for 4/24.

From Last Time

Pong project.

Outline

  1. 2-D transformations: rotation, translation, scaling.

Coming Up

Concatenation of transformations, transformation matrices.

2-D Transformations

Three primitive transformation:

  1. Rotation.

  2. Scaling.

  3. Translation.

We'll consider each in turn.

The idea is to perform all transformations via matrix multiplications:

Preliminaries

I'll assume you're familiar with (from 5.1):

  1. Vector spaces and their properties.

  2. Dot product.

  3. Magnitude of a vector: .

  4. Angle between two vectors:

  5. Properties of matrices.

  6. Some trigonometry:

We're all probably somewhat rusty. I know I am.

Rotation

Consider rotating the point by about the origin.

With a little magic:

What's our transformation matrix look like?

Scaling

  1. ``Contract'' or ``expand'' a point (polygon).

  2. Point moves in relation to origin.

  3. Differential, uniform scalings.

Matrix representation?

Translation

Move the point:

Matrix representation?

Homogeneous Coordinates

  1. Use allows use to achieve translations via matrix multiplications.

  2. Add a third coordinate to a point: .

  3. Two sets of homogeneous coordinates represent the same point iff they are multiples of each other.

  4. A ``homogenized'' point.

Our translation:

Composing Transformations

Can we combine transformations?

  1. Consider composing two translations: , and , .

  2. Consider two scalings.

  3. Consider two rotations.

Types of Transformations

  1. Rigid body. Arbitrary sequence of translations and rotations.

  2. Affine. Parallelism of lines preserved, but not lengths nor angles.

  3. Shear (affine).

    Consider the x-shear transformation:

What's the y-shear transformation matrix look like?

General Compositions

  1. How do we rotate about an arbitrary point?

  2. How do we scale about an arbitrary point?



Thomas P. Kelliher
Tue Apr 18 19:14:38 EDT 2000
Tom Kelliher