# CSE 386: Foundations of Computer Graphics and Games

## Catalog Description:

This course is an introduction to techniques used to create images on the computer. The course covers the algorithms and mathematical theory behind three dimensional image generation with an emphasis on 3D geometry, 3D transformations, and the graphics pipeline. Programming required.

## Prerequisites:

(CSE 274 or CSE 278) and MTH 151

## Required topics (approximate weeks allocated):

• Course introduction (0.5)
• Image-order vs object-order rendering
• Low-level graphics APIs vs software rendering
• Mathematics for computer graphics (2.5)
• Trigonometry review
• Vectors and vector operations
• Matrices and matrix operations
• Colors (0.5)
• RGB color model
• Alpha blending
• Raster displays vs vector displays
• Vectors used in lighting equations
• Equations for ambient, diffuse, and specular color
• Positional lights and spotlights
• Textures (0.5)
• Applying 2D textures to 3D surfaces
• Texture mapping
• Image order rendering (4.0)
• Raytracing overview
• Orthographic and perspective projection
• Computing a camera’s coordinate frame
• Generating viewing rays
• Ray object intersections
• Optional ray tracing features such as: viewports, reflections, and shadows
• Object order rendering (3.0)
• 2D and 3D geometric transformations
• Graphics pipeline:
• Modeling transformation
• Viewing transformation
• Projection
• Perspective division
• Viewport transformation
• Generating geometric shapes procedurally
• Image space algorithms:
• Z buffer algorithm
• Decaling
• Exams (1.0)

## Learning Outcomes:

1. Utilize vector arithmetic to solve geometry problems related to computer graphics
• Express a vector as the sum of a set of linearly independent basis vectors
• Use vector subtraction to find a vector that points from one point to another or find the distance between two points
• Manipulate vectors to produce vectors that are normalized to unit length, have a specified length, or point in a direction that is opposite the original vector
• Use the dot product to compare the directions of vectors or find the component of one vector that is parallel or perpendicular to another
• Use the cross product to find a vector that is normal to the "front" side of a surface, calculate the area of a parallelogram or triangle, and generate an orthonormal basis
2. Describe and implement basic image order algorithms such as ray tracing
• Generate a parametric representation a line or ray given two points
• Generate viewing rays associated with pixel positions for both perspective and orthographic projections
• Represent surfaces implicitly using quadratic equations
• Solve for intersections between rays and surfaces using the quadratic formula
• Calculate reflection vectors and use them to model inter-object reflections
• Generate shadow feelers and use them to simulate shadows associated with both positional and directional light sources
3. Explain and implement shading models such as Lambertian, Gouraud, and Blinn-Phong
• Correctly calculate the ambient, diffuse, and specular reflection given the properties of a light source and the properties of a surface
• Simulate light attenuation based on constant, linear, and quadratic attenuation factors and the distance to a light source
• Correctly combine the diffuse and specular reflections for multiple light sources, to calculate the local illumination
• Specify and utilize material properties and textures to increase surface detail
• Use the dot product to determine whether or not a fragment is within the "beam" of a spotlight