These programming projects accompany an introductory computer graphics course. They cover 2D raster images, 3D geometry, 3D transformations, ray tracing, and the GPU-accelerated graphics pipeline. The assignments have been tested on Mac, Windows, and Linux.
The courses assume familiarity with basic linear algebra, multivariable calculus, and low-level or systems programming.
- Airbrush: Raster images and compositing.
- Raycasting: Ray tracing and 3D transformations.
- Raytracing: Ray tracing and illumination.
- Image Processing: Image processing.
- Meshes: Mesh processing.
- Shaders aka the Graphics Pipeline: The graphics pipeline and GPU shader programming.
-
All assignments will be written in C++. The assignments should ease you in.
-
You will need a working C++ compiler, the CMake build system, and, for the first assignment only (Airbrush), the Qt GUI library. Qt also has a nice integrated development environment (IDE) for C++ called Qt Creator, which is quite useful. Here are my recommended installation instructions:
-
Ubuntu Linux:
apt-get install build-essential cmake qtbase5-dev qtcreator
-
Mac:
- Install the Xcode compiler and IDE.
- Install the Homebrew package manager.
- On the command line, run:
brew install cmake qt
and, if you want the Qt IDE,brew cask install qt-creator
.
- You can use the Qt offline installers (no account needed) or the Qt online installer instead of steps 2 and 3. Install only the latest version of Qt and, optionally, the Qt Creator IDE.
-
Windows: There is a simpler way and a more complicated way:
-
Simpler: Use Qt's online installer. Install the open source version of the Qt environment. This annoyingly requires you to create an account, but in exchange provides a single installer for Qt Creator, the Qt library, and, on Windows, a C++ compiler. The online installer, by default, includes all versions of Qt. This is unnecessary and takes a huge amount of space. Install only the most recent version (e.g. Qt 5.15), the Qt Creator IDE, and the MingW compiler.
-
More complicated:
- Install a compiler. It could be Visual Studio (not VSCode), which provides an entire IDE. It could be MinGW.
- Install CMake.
- Install the Qt GUI libraries and, optionally, the Qt Creator IDE using the Qt offline installers (no account needed) or the Qt online installer. Install only the latest version of Qt and the Qt Creator IDE.
-
-
-
Download each assignment. Inside each folder there is a file named
CMakeLists.txt
.-
You can open it directly with the Qt Creator development environment (IDE) if you are using that.
-
If you aren't using the Qt Creator IDE, from inside each folder, run:
mkdir build cd build cmake ..
Then, to compile the program, just type
make
. There are some useful flags you can pass tocmake
. Try:cmake -DCMAKE_BUILD_TYPE=Debug ..
to compile with debug information for use with a debugger.cmake -DCMAKE_BUILD_TYPE=Release ..
to compile an optimized build. Your code will run much faster.cmake -G Xcode ..
will generate a project for the Xcode IDE on macOS.cmake -G "Visual Studio 16 2019" ..
will generate a project for the Visual Studio IDE on Windows.
-
-
Build and run the code. Make your changes. Write a
Notes.txt
. Hand it in.