February 2019
Intermediate to advanced
292 pages
6h 55m
English

Where translation moves a point by adding to it, scaling moves it by multiplication. When applied to an object centered at the origin, this transformation scales all points on the object, effectively making it larger (if the scale value is greater than 1) or smaller (if the scale value is less than 1), as shown in the figure.
You’ll need a new function, called scaling(x,y,z), that returns a 4x4 translation matrix. Add the following test to demonstrate how it’s used to scale a point.
| | Scenario: A scaling matrix applied to a point |
| | Given transform ← scaling(2, 3, 4) |
| | And p ← point(-4, 6, 8) |
| | Then ... |
Read now
Unlock full access