Vector and Affine Spaces, Frames, and Homogeneous Coordinates

Tom Kelliher, CS 320

Apr. 10, 2009

Administrivia

Announcements

Assignment

Read Chapter 5.

From Last Time

Animating the color cube.

Outline

  1. Introduction.

  2. Vector spaces, affine spaces, lines.

  3. Affine sums and convex hulls.

  4. The plane and normal vectors.

  5. Coordinate systems and frames.

  6. Homogeneous Coordinates

Coming Up

Viewing

Introduction

Properties of scalars, points, vectors.

Uses in graphics?

Vector Spaces

  1. Two entities: scalars, vectors.

  2. Defined operations: scalar-vector multiplication, vector-vector addition.

    Examples.

Affine Spaces

  1. Vector space plus.

  2. Additional object: point.

  3. Additional operation: vector-point addition, yielding a point.

    Equivalently, point-point subtraction, yielding a vector.

    Examples.

Lines

Consider:

\begin{displaymath}
P(\alpha) = P_0 + \alpha d.
\end{displaymath}

where $P_0$ is an arbitrary point, $d$ is an arbitrary vector, and $\alpha$ is a scalar.

$P(\alpha)$ is what?

What happens when we vary $\alpha$? -- Parametric form of the line.

Affine Sums and Convex Hulls

  1. No point-point addition or scalar-point multiplication. But...

  2. For a point $Q$, vector $v$, and scalar $\alpha$

    \begin{displaymath}
P = Q + \alpha v.
\end{displaymath}

    But we can find $R$ such that:

    \begin{displaymath}
v = R - Q.
\end{displaymath}

    So:

    \begin{displaymath}
P = Q + \alpha (R - Q) = \alpha R + (1 - \alpha)Q
\end{displaymath}

  3. If we extend this to $n$ points:

    \begin{displaymath}
P = \alpha_1 P_1 + \alpha_2 P_2 + \cdots + \alpha_n P_n,
\end{displaymath}

    where $\sum \alpha_i = 1$ and $\alpha_i \geq 0$ then we get the convex hull of the points.

The Plane

  1. The plane can be parametrically defined by a point and two non-parallel vectors:

    \begin{displaymath}
P = P_0 + \alpha u + \beta v
\end{displaymath}

    or

    \begin{displaymath}
P - P_0 = \alpha u + \beta v.
\end{displaymath}

  2. Find a normal vector:

    \begin{displaymath}
n = u \times v.
\end{displaymath}

    So:

    \begin{displaymath}
n \cdot (P - P_0) = 0
\end{displaymath}

  3. This is another parametric form of the plane. $n$ is normal to that plane.

Coordinate Systems and Frames

  1. Vectors have no positions, although we often think they do.

  2. For transformation purposes, we want to represent a graphical point as a vector relative to an origin.

  3. A frame is a vector basis and a reference point (origin): $(v_1, v_2, v_3, P_0)$.
    1. Any point can be represented:

      \begin{displaymath}
P = P_0 + \alpha_1 v_1 + \alpha_2 v_2 + \alpha_3 v_3
\end{displaymath}

    2. Any vector can be represented:

      \begin{displaymath}
w = \beta_1 v_1 + \beta_2 v_2 + \beta_3 v_3
\end{displaymath}

  4. Ambiguous as to whether an object is a point or a vector.

  5. Transformations are accomplished by changing the basis. From $(
v_1, v_2, v_3)$ to $(w_1, w_2, w_3)$.

    How is this done for scaling and rotation? Translation? (Everything is relative to original origin in matrix multiplications.)

    How does this affect a point in the original frame?

Homogeneous Coordinates

  1. Explicitly include the origin in the point/vector representation: $(v_1, v_2, v_3, P_0)$.

    Change basis to $(w_1, w_2, w_3, P_1)$

  2. Point, vector representations are different $(\alpha_1, \alpha_2,
\alpha_3, 1)$, $(\beta_1, \beta_2, \beta_3, 0)$.



Thomas P. Kelliher 2009-04-10
Tom Kelliher