CS488 - Introduction to Computer Graphics - Lecture 6

Comments and Questions

  1. View frame.

Device Transformations

Windows

On the view plane

Viewports

On the device

Normalized Device Coordinates

For the device, obviously


Clipping

What is it?

Representations of Lines

  1. Parametric
  2. Implicit

Clip a Point against a Line

This means: which side of a line Q - P is a point R, above it or below it?

Clip a Point against a Half-space.

Representation of a Half-space.

Calculate d = ( R - P ) . n

The direction of n has been chosen to point towards the inside.

Clip a Line Segment to a Half-space.

The line segment

Test if each of R and S are inside. Calculate

  1. ( R - P ) . n
  2. ( S - P ) . n

There are three cases

  1. Both inside: keep the segment as is.
  2. Both outside: discard the segment.
  3. One inside, one outside: the segment crosses the boundary of the half-space.

Clip a Line Segment to a Rectangle

Define a rectangle as a collection of half spaces, then it is straightforward. Really?


Perspective Projection

For a comprehensive introduction to perspective projection, more than most of you want to know, look at this pdf.

What is a projection?

Projective transformations are a superset of affine transformations.

  1. They do not preserve ratios of distance.
  2. They do not preserve affine combinations.
  3. They do not map vectors.
  4. They do preserve the cross ratio.

Show 1D transformation on the board

  1. Illustration in 2D. What does this mean? (Hint. homogeneous coordinates)
  2. Projection point on one of the lines.
  3. Relevance of the intersection point of two lines.
  4. How the transformation changes as the projection point moves around.

Perspective Projection from 1D to 1D

The 1D Cartesian Space.

Projection from a 1D space to a 1D space.

  1. We draw it in two dimensions (Why?)
  2. Pencil of lines through a projection point: all points on a line are the `same' point.
  3. Affine transformations from 1D to 1D

What does this type of projection have to do with computer graphics?


Return to: