← All projects

Geometric Transformations for Computer Graphics

Three SageMath labs on affine transformations, parametric surfaces and quaternion rotations for the Geometric Transformations for Computer Graphics course (MIRI, UPC).

View source on GitHub →

Three lab exercises for the Geometric Transformations for Computer Graphics course (MIRI, UPC), each a self-contained SageMath notebook.

Lab 1 — Affine transformations

First contact with affine transformations and matrix multiplication: rotating, scaling and translating objects in 3D by composing transformation matrices. The final exercise consists of building cubes and positioning them at specific coordinates purely through matrix math.

Lab1 final exercise

Qualification: 9.00/10.00 — feedback: some dot products (angles) in the last exercise were not really needed.

Lab 2 — Parametric surfaces

Introduction to defining and drawing objects using parametric surfaces. The final exercise is a toothpaste tube, modeled and rendered entirely from parametric equations.

Lab2 final result

Qualification: 10.00/10.00

Lab 3 — Quaternions and rotations

Using quaternions and Rodrigues’ rotation formula to model rigid-body rotations. The final exercise renders two champagne glasses at the exact moment of a toast, touching at a single point, with their orientation computed via Rodrigues’ formula.

Lab3 final result

Qualification: 10.00/10.00

Exercise presentation

Qualification: 2.00/2.00