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


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.
Computer graphics are programmed pretty pictures.

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 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)


Modeling Animation Rendering

(Sometimes optional)

...But usually artists. (UCBUGG)


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


What is



Linear Algebra: Questions

Given two

\vec{i}\cdot\vec{i}=1, \vec{i}\cdot\vec{j}=0, \vec{j}\cdot\vec{j}=1

  1. Does a vector
    exist, such that
    ? What is it? How many are there?
  2. Does a vector
    exist, such that
    ? What is it? How many are there?
  3. Do the answers change if
    are in

Linear Algebra: Questions


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?


be any point in the plane containing
. What is the geometric relationship between
(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.