CS184 Section 1
Introduction/Linear Algebra

Brandon Wang
January 24, 2012
Material adapted from Fu-Chung Huang, Ravi Ramamoorthi, and Carlo Sequin

Logistics/About Me

Today

Computer Graphics

Source: Disney/Pixar Toy Story 3

Computer Graphics

Source: Valve Portal 2

Computer Graphics

Source: Apple Mac OS X Lion

Other Applications

Computer graphics are graphics created using computers and, more generally, the representation and manipulation of image data by a computer with help from specialized software and hardware.
Wikipedia
Computer graphics are programmed pretty pictures.
Me

Our class

We're primarily focusing on the Computer Science part of 3D Computer Graphics.

For our assignments, we'll be using C++, OpenGL, and GLSL.

What we learn can be extended to any language (Python, Java, Scheme...), and we learn the underlying theory behind it all. (So you can use DirectX later... If you really, really, really want to.)

Modeling

Modeling Animation Rendering
v -3.000000 1.800000 0.000000
v -2.991600 1.800000 -0.081000
v -2.991600 1.800000 0.081000
v -2.989450 1.666162 0.000000
...
Usually created by artists (UCBUGG), but can be scanned, math function (on an assignment)

Animation

Modeling Animation Rendering

(Sometimes optional)

...But usually artists. (UCBUGG)

Rendering

Modeling Animation Rendering

Source: CS184 Fu-Chung Huang

Linear Algebra: Vectors

Linear Algebra: Vector Addition

Linear Algebra: Dot (Scalar) Product

Linear Algebra: Cross (Vector) Product

Linear Algebra: Orthonormal Bases/Coordinate Frames

Linear Algebra: Matrices

\left( \begin{matrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{matrix} \right)

Linear Algebra: Matrix Multiplication

(AB)_{i,j} = \sum_{k=1}^p A_{ik}B_{kj}

Linear Algebra: Matrix Transpose

Linear Algebra: Identity Matrix

I_1 = \begin{bmatrix} 1 \end{bmatrix} ,\ I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} ,\ I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} ,\ \cdots ,\ I_n = \begin{bmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{bmatrix}

Linear Algebra: Transformations

Linear Algebra: Transformations

Think about it this way:

(Credit to XKCD and Brian Maissy for posting it on Piazza)

Linear Algebra: Questions

1. Find the length of vector

\vec{x} = \left( \begin{matrix} 3\\-6\\2 \end{matrix} \right)

||\vec{x}|| = \sqrt{3^2+(-6)^2+2^2} = 7

2.

What is

\vec{x}\times\vec{z}

-\vec{y}

Linear Algebra: Questions

Given two

\mathbb{R}^2
vectors,
\vec{i}
and
\vec{j}
,
\vec{i}\cdot\vec{i}=1, \vec{i}\cdot\vec{j}=0, \vec{j}\cdot\vec{j}=1

  1. Does a vector
    \vec{k}
    exist, such that
    \vec{k}\neq\vec{i}
    ,
    \vec{k}\cdot\vec{k}=1
    ,
    \vec{k}\cdot\vec{j}=0
    ? What is it? How many are there?
  2. Does a vector
    \vec{k}
    exist, such that
    \vec{k}\cdot\vec{i}=0
    ,
    \vec{k}\cdot\vec{k}=1
    ,
    \vec{k}\cdot\vec{j}=0
    ? What is it? How many are there?
  3. Do the answers change if
    \vec{i}
    and
    \vec{j}
    are in
    \mathbb{R}^3
    ?

Linear Algebra: Questions

Given

p_1, p_2, p_3 \in \mathbb{R}^2

vectors, consider the cross product
n = (p_2-p_1)\times(p_3-p_1)

What does this vector mean geometrically?

Let

p
be any point in the plane containing
p_1,p_2,p_3
. What is the geometric relationship between
p-p_1
and
n
(look at their dot product)?

Linear Algebra: Questions

Write the parametric equation for a line through points p1 and p2. Now write the parametric equation for a plane through points p1, p2, and p3.

Show how to restrict these parametric equations to specify only the points on the line segment between p1 and p2 for the line, and only the points inside the triangle formed by p1, p2, and p3 for the plane.

Thanks!