The "Groups" chapter of the book gives some tips about how to implement bounding boxes, but really leaves it up to you. If you found the tips hard to follow, fear not! This newest bonus chapter takes you through the process of implementing those bounding boxes, with tests, and then goes even farther! You'll learn how to take those bounding boxes and build a bounding volume hierarchy out of them, which should make it feasible to render even the most complex models in a reasonable length of time.
I’m making progress here but my inherited materials don’t seem to be working quite right. Also, my bounding boxes appears to be higher in y than should be, but I probably just applied the transformations backwards for those nested defined objects in the Yaml. Any tips on the expected behavior of the material inheritance?
Alas, my project laptop is off to apple for a battery recall, so I can't dig through my own code to share specifics. However, I've generally implemented material inheritance by having a method on Shape (or a utility function somewhere) that checks to see if the shape has a defined material. If it does not, it then walks the parent chain, looking for the first parent with a valid material. This does require that your language support optional values (perhaps null, or similar). In the root case, where a shape has no parent AND has no defined material, the method returns a new material with default values.
I don't know if that's helpful or not. It looks like you're on the right track, though, as far as the chapter goes!
Thanks, Jamis. I got that scene rendering correctly, but I think I still have a problem with material inheritance somewhere in the Orrery scene. The long stems that hold up the planets don't seem to be shading gold, but I haven't dug into it yet. I got all 339 tests passing and took a bit of a break from it before I start adding more of a UI and more performance optimizations.