CS 381 Fall 2012: Computer Graphics

CS 381 Fall 2012
Computer Graphics

Department: Computer Science, UAF
Instructor: Glenn G. Chappell
Office: 201B Chapman
Office Hours: 11:45–1:45 MWF on fall 2012 class days, or by appointment
Office phone: (474-)5736
E-mail: ggchappell@alaska.edu
Paper mailbox: Inside the CS Department office, 202 Chapman

Announcements

Course Materials

Materials are listed with the most recent at the top.

Week Class Meetings Readings & Homework Handouts, Sample Code, Etc.
Week 15 
& Finals 
12/10–12/15 
  • 12/15: Final Exam 1–3 p.m.
   
Week 14 
12/3–12/7 
  • 12/6: Student presentations (see schedule); general review
  • 12/4: Student presentations (see schedule)
Week 13 
11/26–11/30 
  • 11/29: Student presentations (see schedule)
  • 11/27: The Processing programming language (cont’d); sample presentation
 
  • processing_sierpinski.html [HTML]
    Processing demo: Sierpinski gasket
    Requires sierpinski.pde
    Requires processing-1.4.1.min.js (from Processing.js site)
    Written Tue 11/27
  • sierpinski.pde [Processing source]
    Processing source code for Sierpinski gasket demo
    Written Tue 11/27
Week 12 
11/19–11/21 
  • 11/22: No class (Thanksgiving)
  • 11/20: HTML canvas API (cont’d); the Processing programming language
 
  • processing_tstrip.html [HTML]
    Processing demo: triangle strip
    Requires tstrip.pde
    Requires processing-1.4.1.min.js (from Processing.js site)
    Written Tue 11/20
  • tstrip.pde [Processing source]
    Processing source code for triangle strip demo
    Written Tue 11/20
  • canvas_bezier.html [HTML/JavaScript]
    HTML5 canvas demo: Bézier curve
    JavaScript code included in HTML file
    Written Tue 11/20
Week 11 
11/12–11/16 
  • 11/15: Unit overview—other graphics systems; HTML5 canvas API
  • 11/13: Presentation sign-up; refraction mapping
    Lecture notes
Week 10 
11/5–11/9 
  • simpletex.cpp [C++ source]
    Simple texure-using application
    Runs with _tex & _textan shaders
    Written Sat 11/10
  • envir.cpp [C++ source]
    Render an environment map
    Requires lib381/rtt.h
    Runs with _cube shaders
    Also requires twoside shaders
    Written Thu 11/8 Revised Tue 11/13
  • rendercube.cpp [C++ source]
    Render a cube map
    Requires lib381/rtt.h
    Runs with _cube shaders
    Written Thu 11/8
  • rendertex.cpp [C++ source]
    Render a texture
    Requires lib381/rtt.h
    Runs with _tex & _textan shaders
    Written Thu 11/8
  • rtt.h [C++ header]
    Header for class RTT: render-to-texture
    There is no associated source file
    File should be placed in subdirectory lib381
    Written Thu 11/8
  • rm_cube_shaders.zip [ZIP archive]
    Shaders for use with usecubemaps.cpp
    Reflection mapping using a cube map
    Written Tue 11/6
  • usecubemaps.cpp [C++ source]
    Use cube map shaders
    Runs with _cube shaders
    Written Tue 11/6
  • rmsphere_tex_shaders.zip [ZIP archive]
    Shaders for use with usetextures.cpp
    Reflection mapping using a sphere map
    Written Tue 11/6
  • rmsimple_tex_shaders.zip [ZIP archive]
    Shaders for use with usetextures.cpp
    Simple (too simple!) reflection mapping
    Written Tue 11/6
Week 9 
10/29–11/2 
 
  • brown_textan_shaders.zip [ZIP archive]
    Shaders for use with proctex.cpp
    Bump mapped brown stuff (wood?)
    Written Sun 11/4
  • bump_textan_shaders.zip [ZIP archive]
    Shaders for use with proctex.cpp
    Bump mapping
    Written Thu 11/1
  • proctex.cpp [C++ source]
    Procedural texture
    Requires lib381/pnoise.h
    Runs with _tex & _textan shaders
    Written Thu 11/1
  • pnoise.h [C++ header]
    Header for noise functions for procedural texture
    There is no associated source file
    File should be placed in subdirectory lib381
    Written Thu 11/1
  • blast.cpp [C++ source]
    Billboarding & blending demo
    Runs with _tex shaders
    (basic_tex shaders recommended)
    Written Tue 10/30
    Revised Thu 11/1
  • light_tex_shaders.zip [ZIP archive]
    Shaders for use with usetextures.cpp
    Lighting + multiple textures
    Written Tue 10/30
  • minfilters.cpp [C++ source]
    Min filter demo
    Runs with _tex & _textan shaders
    Written Tue 10/30
    Revised Thu 11/1
  • whatever_tex_shaders.zip [ZIP archive]
    Shaders for use with usetextures.cpp
    Whatever I feel like doing with textures
    Written Tue 10/30
Week 8 
10/22–10/26 
  • 10/25: Unit overview—textures & mapping techniques; introduction to textures
    Lecture notes
  • 10/23: Front & back of polygons; fancy lighting
    Lecture notes
  • basic_tex_shaders.zip [ZIP archive]
    Shaders for use with usetextures.cpp
    Basic texture mapping
    Written Thu 10/25
  • usetextures.cpp [C++ source]
    Use texture shaders
    Requires GLEW, lib381/glslprog.h, lib381/tshapes.h, shader source files
    Runs with _tex & _textan shaders
    Written Thu 10/25
    Revised Tue 10/30
    Revised Thu 11/1
  • tshapes.h [C++ header]
    Header for 3-D shapes with texture coordinates
    There is no associated source file
    File should be placed in subdirectory lib381
    Written Thu 10/25
    Revised Thu 11/1
  • Quiz 5 Solutions [PDF]
    Quiz given Thu 10/25
  • cel_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    Cel shading (two-sided)
    Written Tue 10/23
  • spot_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    Spotlight (two-sided)
    Written Tue 10/23
  • attenmult_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    Attenuation, multiple light sources (two-sided)
    Written Tue 10/23
  • twoside_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    Two-sided coloring & lighting
    Written Tue 10/23
Week 7 
10/15–10/19 
  • 10/18: Phong illumination; computing normals
    Lecture notes
  • 10/16: Midterm Exam
 
  • torus_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    Example of vertex repositioning, normal-vector computation
    Written Thu 10/18
  • lambertfrag_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    Per-fragment lighting, Lambertian illumination model
    Written Thu 10/18
  • bpfrag_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    Per-fragment lighting, Blinn-Phong illumination model
    Written Thu 10/18
  • bpvert_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    Per-vertex lighting, Blinn-Phong illumination model
    Written Thu 10/18
  • phongvert_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    Per-vertex lighting, Phong illumination model
    Written Thu 10/18
  • Midterm Exam Solutions [PDF]
    Exam given Tue 10/16
Week 6 
10/8–10/12 
 
Week 5 
10/1–10/5 
  • 10/4: Unit overview: shaders & lighting; vector operations; introduction to shaders; the basics of GLSL
    Lecture notes
  • 10/2: Hierarchical objects; vertex arrays
    Lecture notes
  • dabble_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    Dabbling in shaders: what can they do?
    Written Thu 10/4
    Revised Tue 10/9
  • plain_shaders.zip [ZIP archive]
    Shaders for use with useshaders.cpp
    “Plain” shaders: do not do much
    Distributed in class Thu 10/4
  • useshaders.cpp [C++ source]
    Use various shaders
    Requires GLEW, lib381/glslprog.h, shader source files
    Written Thu 10/4
    Revised Tue 10/9
    Revised Tue 10/11
  • ebodemo.cpp [C++ source]
    Element buffer object demo
    Requires lib381/ebo.h & lib381/vbo.h
    Written Tue 10/2
  • ebo.h [C++ header]
    Header for class EBO
    Wrapper for OpenGL element buffer object
    There is no associated source file
    File should be placed in subdirectory lib381
    Requires lib381/vbo.h
    Written Tue 10/2
  • vbodemo.cpp [C++ source]
    Vertex buffer object demo
    Requires lib381/vbo.h
    Written Tue 10/2
  • vbo.h [C++ header]
    Header for class VBO
    Wrapper for OpenGL vertex buffer object
    There is no associated source file
    File should be placed in subdirectory lib381
    Written Tue 10/2
  • arm.cpp [C++ source]
    Hierarchical object demo
    Written Tue 10/2
Week 4 
9/24–9/28 
  • flyer.cpp [C++ source]
    Flight simulator
    Requires lib381/whereami.h
    Written Thu 9/27
  • whereami.h [C++ header]
    Header for camera-position computation
    There is no associated source file
    File should be placed in subdirectory lib381
    Written Thu 9/27
  • manip2.cpp [C++ source]
    Object manipulation—improved
    Written Tue 9/25
  • manip.cpp [C++ source]
    Object manipulation
    Written Tue 9/25
  • Quiz 3 Solutions [PDF]
    Quiz given Tue 9/25
  • check_glsl.cpp [C++ source]
    Check that GLSL works
    Used in Assignment 3, Exercise A
    Requires lib381/glslprog.h
    Written Mon 9/24
  • glslprog.h [C++ header]
    Header for shader-handling utilities
    There is no associated source file
    File should be placed in subdirectory lib381
    Written Mon 9/24
Week 3 
9/17–9/21 
  • 9/20: The details of transformations; hidden-surface removal
    Lecture notes
  • 9/18: Picking; unit overview—transformations & viewing; introduction to 3-D; vectors & matrices
    Lecture notes
 
  • showmat.cpp [C++ source]
    Display a transformation matrix
    Written Wed 9/19
  • select.cpp [C++ source]
    Advanced picking demo #2: querying the clipper
    Written Tue 9/18
  • readfb.cpp [C++ source]
    Advanced picking demo #1: reading the framebuffer
    Written Tue 9/18
  • clickdrag.cpp [C++ source]
    Click-and-drag demo
    Written Tue 9/18
  • Quiz 2 Solutions [PDF]
    Quiz given Tue 9/18
Week 2 
9/10–9/14 
Week 1 
9/4–9/7 
  • 9/6: OpenGL primitives; quickie text; unit overview—animation & interaction; events; the keyboard in GLUT
    Lecture notes
  • 9/4: Intro to OpenGL; GLUT programs
    Lecture notes
  • textkbd.cpp [C++ source]
    GLUT text & keyboard demo
    Requires lib381/bitmapprinter.h
    Distributed in class Thu 9/6
    Revised Thu 9/6
  • bitmapprinter.h [C++ header]
    Header for class BitmapPrinter
    There is no associated source file
    File should be placed in subdirectory lib381
    Written Wed 9/5
  • check_opengl.cpp [C++ source]
    Check that OpenGL & GLUT work
    Used in Assignment 1, Exercise A
    Written Wed 9/5
Week 0 
8/30–8/31 
  • 8/30: Course overview; unit overview—basic computer graphics programming; introduction to computer graphics
    Lecture notes
 
  • sample1.cpp [C++ source]
    Sample 2-D OpenGL/GLUT program
    Distributed in class Tue 9/4
  • Syllabus
    Distributed in class Thu 8/30

External links last checked September 24, 2012.
OpenGL 2.1 Reference Pages
Manual pages for every function in the OpenGL spec. (If you do not like the format of this site, then search. OpenGL manual pages are found on many websites.)
The OpenGL Machine [PDF]
A full block diagram of the OpenGL rendering pipeline.
GLUT API
Documentation for GLUT functions.
GLEW: The OpenGL Extension Wrangler Library
A package for managing OpenGL extensions. Required for compiling and executing any of the applications in this course that make use of GLSL shaders.
GLSL Tutorial
A nice tutorial on GLSL, at Lighthouse 3D. I have found this tutorial useful for filling in gaps in my own knowledge. Recommended.
GLSL Quick Reference Guide [PDF]
A two-page GLSL cheat sheet. Very helpful.
GLSL Reference Pages
Documentation for GLSL functions. I have found this useful, although it does not answer all of my questions.
The Processing Language
The official site for Processing, a programming language aimed at graphics. The language reference/API section of this site includes a complete listing of all built-in functions in the language (very helpful!).
Processing.js
The official site for Processing.js, a Processing-to-JavaScript compiler written in JavaScript, which allows convenient execution of Processing programs in a web browser. Processing.js is used in the Processing example programs written in class; find the required file in the downloads section of this site.


CS 381 Fall 2012 / Updated: 10 Dec 2012 / Glenn G. Chappell / ggchappell@alaska.edu