Lab: Matrix Transformations
In this chapter, you've been learning how to represent triangle meshes and generate algorithmic shapes like cones, cylinders, and spheres. Let's apply this knowledge by writing a renderer that generates a torus—a donut.
Form a group of no more than three people. Host, open your top-level repository directory in Visual Studio Code and run npm run dev
to start up a web server. Then open the command palette via View / Command Palette and enter Live Share: Start Collaboration Session. Share the link with your group.
Transfit Again
Your first challenge is to rework your transfit
renderer to use matrices. Follow these steps:
transfit
renderer to make a transfit-matrix
renderer.radians
, offsets
, and factors
uniforms from the vertex shader and main script.worldFromModel
matrix that achieves the same effect.Saguaro
Your second challenge is to model, load, and render a saguaro model transformed by matrices. Follow these steps:
.gltf
format, not the binary .glb
.transfit-matrix
renderer to make a saguaro
renderer.Submission
To receive credit for your lab work, follow these steps:
transfit-matrix
and saguaro
folders before the host closes the session.#lab
channel in Discord. No voiceover is necessary. Tag your group members with @
.Only labs submitted on time will be granted credit. Late labs or forgot-to-submits are not accepted because Monday at noon is when your instructor has time to grade.