Welcome to Computer Graphics. This course serves as an introduction to the area of graphics. We will learn many of the basics of modeling and rendering from a modern OpenGL approach. This course will feature lots of programming, and lots of math, but the math is not super complex. We will design many cool projects, but if you are expecting to design a full fledged 3D game, or the next LOTR movie, this course will not meet your expectations. This course is designed around understanding core concepts and prepare you to explore more advanced topics in computer Graphics.
Reading
Please get the text book and read over Chapters 1 and 2. Be sure to read 1.2.1, 1.2.2 and 1.3-1.8. You can skim/skip the rest of Chapter 1. Don't worry about programming details or the actual Sierpinski Gasket in Chapter 2. Read for concepts and ideas, not code fragments. While the book uses
glut as the windowing environment, we will be using
QT which has similar functionality but completely different syntax.
An Overview of Computer Graphics
- Modeling: representing 3D objects with geometric primitives: points, lines, triangles
- Scene Creation: arranging objects in the 'world' using transformations
- Projections: setting up a viewpoint from which to visualize the world
and converting a 3D scene to 2D
- Rendering: Transforming the 3D model into a 2D image on the computer screen (pixels/fragments)
Software Tools
- OpenGL : graphics framework
- glew : extension wrangler (don't ask)
- glsl : shading language
- C++ : our language of choice
- CMake : for building/compiling complex software projects
- Git : for managing source code, sharing
- QT : for designing interactive graphical applications
- CUDA : GPGPU programming
Math Concepts
- Linear Algebra
- Matrices (4x4)
- Vectors (4x1)
- Dot product
- Cross product
- Matrix/Vector product
- Affine Transformation
- Frames, Orthogonal Bases
- Trigonometry
Hardware
- GPU
- optimized for vector math
- highly parallel
- SIMD
- programmable (shaders/CUDA)
- Displays
- 3D Displays
- 3D Printing
Wednesday
Getting Started
This semester I would like to replace our homemade handin/update system with something a little more modern/useful:
git. This is an experiment in progress. To get started, I will need a public SSH key from you. If you have one, great! If not, we'll create one.
First run
update40, then follow the instructions for
Creating SSH keys.
Test your setup by running
ssh-add then trying to connect to another CS host. You should not be asked for your CS password. Next copy your
public SSH key to your
cs40/pubkey directory.
cp ~/.ssh/id_rsa.pub ~/cs40/pubkey
Now wait while I feed the unicorns...
You should now be able to clone the git repository for the course. This will hopefully replace update 40
cd ~/cs40
git clone gitrepos:cs40s13 code
cd code
git checkout -b working
Wednesday Lab
Lab Exercise
Friday
Piazza: You should have received an invite. Please sign up, ask questions.
Class startup
- Log in
- ssh-add
- cd ~/cs40/code
- git remote show origin #(just today. Verify URL gitrepos:cs40s13)
- git branch #(verify you are on a working branch)
Wednesday review
Using CMake
cd ~/cs40/code
mkdir build #if it doesn't already exist
cd build
cmake .. #if you haven't run cmake before
make -j4 #compile
You
compile,
run, and
test programs in the
build directory. You
edit source files outside of the
build directory. You may want to have one terminal window open for running programs, and a separate terminal for editing.
Using QT
Today I would like to walk through the creation of simple QT application and demonstrate
qtcreator. For more details, see the
exercise on the course wiki.
Practicing git
verify that any recent changes have been committed to your working branch
git status
git add <file>
git commit
switch to the master branch and get changes
git checkout master
git pull
git checkout working
git merge master
You should have a
Friday.txt file. This file is silly. You can remove it from version control
git rm Friday.txt
git commit
Use
git rm or
git mv to remove/move files under version control.
Monday Preview
- First lab project: image editor in QT
- Using pixel buffers, rgb tuples
- Submitting code with git
- Sharing code with partners
- OpenGL!