February 2019
Intermediate to advanced
292 pages
6h 55m
English
Once you know the points of intersection, the normal vector is used to help shade the surface appropriately. You’ll only need one scenario to cover this bit.
Show that the normal vector on the surface of a cylinder is computed correctly.
This scenario chooses four points on the surface of the cylinder, one each at +x, -x, +z and -z, and shows that the normal is the expected value at each point.
| | Scenario Outline: Normal vector on a cylinder |
| | Given cyl ← cylinder() |
| | When n ← local_normal_at(cyl, <point>) |
| | Then n = <normal> |
| | |
| | Examples: |
| | | point | normal | |
| | | point(1, 0, 0) | vector(1, 0, 0) | |
| | | point(0, 5, -1) | vector(0, 0, -1) | ... |
Read now
Unlock full access