February 2019
Intermediate to advanced
292 pages
6h 55m
English
Look back at the program you wrote at the end of the previous chapter. It’s time to clean that up, taking advantage of the world and camera that you’ve just written and adding a few more spheres to make the scene more interesting.
Here’s one example of what you might build:

This was constructed from six spheres, arranged as follows:
The floor is an extremely flattened sphere with a matte texture.
| | floor ← sphere() |
| | floor.transform ← scaling(10, 0.01, 10) |
| | floor.material ← material() |
| | floor.material.color ← color(1, 0.9, 0.9) |
| | floor.material.specular ← 0 |
The wall on the left has the same scale and color as the floor, but is ...
Read now
Unlock full access