Intro to Computer Graphics Coursework

Collection of the 4 assignments I completed for the Intro to Computer Graphics course (Computer Science 453 at the University of Calgary) I took in fall 2017.

Source code

Hilbert Curve

Features

  • Rendering done with OpenGL.
  • Draws first to tenth order Hilbert Curves using OpenGL’s lines as well as by using thin triangles.

7th order Hilbert Curve

Credits

  • Regarding the software implementation the following resources were invaluable:

Image Manipulation

Features

  • Rendering done with OpenGL.
  • Draw multi-colored Catmull-Rom curves and loops.
  • Apply image filters (grayscale and 2-bit quantization).
  • Grayscale filter uses NTSC conversion weights.
  • Move and scale the image.

All effects active

Original image

Grayscale

2-bit image quantization

Credits


Model Viewer and Editor

Features

  • Rendering done with OpenGL.
  • Models can be selected by mouse clicking on them.
  • Selected models can be modified by rotating, scaling, translating, duplicating, or turning various textures on or off.
    • Powerful enough to build the demo scene by hand.
  • Supports basic OBJ features and models/textures can be imported with a config file or command-line arguments.
  • Phong lighting model using diffuse, specular and ambient occlusion textures.

Scene demoing model viewer

Credits

  • All models and textures shown in the image were provided to us by the TA as part of the course.
  • Regarding the software implementation the following resources were invaluable:

Whitted Ray Tracer

Features

  • CPU only and thus does not make use of OpenGL in any way.
  • Ray intersection test for spheres and triangles.
  • Functional shadow, reflection, refraction, and diffuse bounces.
  • Gamma correction.
  • Procedural textures.
  • Directional and point lights.
  • Supports basic OBJ features and models can be loaded with a config file.

My custom scene

Default Cornell box

Credits

  • All models either made by me or specified in the assignment description.
  • Most of the ray tracer code was based on Scratchapixel.