*Host Team: Brian Benander, John Figueroa, Paul Tagliamonte*

# Bio

Jason is a recent Computer Science graduate from John Carroll University, University Heights of Ohio. Currently Jason is working toward a Master in Computer Graphics and Motion Technology at DePaul University. His current enrollment has Jason taking two courses a week full time with a majority of his programming in C++. The coursework in his class has primarily revolved around derivations and the importance of math in his courses. The biggest point made in taking these upper-level courses involves utilizing the learned formulas to implement a working program. Jason made the point that with his current track, one must know how to program and do math. Jason pointed out that math does not change. He backed up this claim by noting that his Computer Graphics book was made in 1990.

# Computer Graphics Math Basics

point-(x,y,z)

- position

vector-<x,y,z>

- direction
- magnitude
- no position!

matrix-

- apply matrices in TRS (point) order

# Dot product

- The dot product is probably the most important formula in Computer Graphics (CG)
- One use: check to see if a polygon is front facing
- How do you calculate the angle between two vectors?

- theta = aCos ((Ax * Bx) + (Ay * By) + (Az + Bz))

# Cross Product

- Given 2 non parallel vectors how do you find a third vector that is mutually perpendicular to both
- Used to computer surface normals

< Vx, Vy, Vz > X < Wx, Wy, Wx>

< (Vy*Wz – Vz*Wy) , (Vz*Wx – Vx*Wz) , (Vx*Wy – Vy*Wx) >

# Projection

What part of V is parallel to W?

- Dot( V , W ) / ( X^2 + Y^2 + Z^2 )

# Shading

*Faceted*- 1 lighting calculation per polygon

*Gouraud*- 1 lighting calculation per vertex

*Phong*- 1 lighting calculation per pixel

-Color is interpreted by vertices.

# Lighting (phong illumination model*)

- color = ambient + diffuse + specular
- ambient = color * * light intensity
- diffuse = (color * light intensity) * dot product (light, normal)
- specular = (color * light intensity) * dot product (reflection, view) ^k

The closer the reflective vector is to your eye, the brighter the highlight

# Rendering Types

## Wire Frame

-can see all vertices and edges

## Hidden Line

-faces, edges, and vertices in the back are hidden

## Z-Buffer

-most used rendering technique

-can not do self reflection

-look at every pixel only once

-uses depth of objects to draw

-one memory block to hold the color information

-much faster then ray tracing

# Ray tracing

-reflection and refraction

## Ray Tracing Uses

~Computer Graphics, stills, movies

~more realistic images

~The biggest problem: rendering is very time consuming

- Very good for realism in CG stills and movies because each frame can be pre-rendered.
- Not very good for video games.
- Shoot a ray (vector from the camera through ever pixel in the screen and see what this vector collides with.
- If it collides with an object in the scene calculate the color.
- If the object the ray collides with is reflective or refractive, shoot a new ray out from the object and see what it collides with.
- If the new ray collides with an object calculate the color of the pixel based. of all rays.

# Environment Mapping

- Fake ray tracing in a Z-buffer render

** one bounce ray tracer

- The reflection on the teapot is actually a texture
- Remove the object you would like to environment map from the scene. Take a picture 6 ways (Up, Down, Left, Right, Front, Back)
- Use these 6 textures in a cube map on the teapot