2-D Transformations

Tom Kelliher, CS 320

Feb. 23, 1998

Announcements: Homework due tonight.

From last time:

  1. Pong.

Outline:

  1. Idea.

  2. Preliminaries.

  3. Transformations.

Assignment: Read Chapter 5.

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. The vector 2-norm: .

  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
Sun Feb 22 21:58:29 EST 1998
Tom Kelliher