To celebrate that cylinders can be constrained and capped at the ends, we have a remake of the cubemas scene from a few days ago, but with today’s shiny new cylinders instead of cubes.
Devember is rapidly coming to an end, but so is the book. Just a few more shapes to go, and we’re done. Except the easy shapes are already done, so things get more complicated from here. Cylinders seem pretty easy, just a XZ-planar circle, extruded along the Y axis. Done. Except that it gets infinitely long that way, so it needs to be constrained. But then it’s hollow, so it needs to support optional end caps for when you need a closed cylinder and not just a very thin walled tube. So it’s not done yet, but probably new pixels tomorrow.
Oh my god, it’s full of cubes! The scene consists of 8 cubes, two for the room, five for the table, and the traditional cubemas decoration of one glass cube on the table.
All core functionality is in place, so time for more shapes. First up is cubes, the volume contained by three perpendicular pairs of parallel planes, and aligned with the axes. So planar ray intersection with each one, and pick the snuggest fit to intersect the cube. Not quite pixel ready yet, so something for tomorrow.
Remember when we introduced shadows? Casting a ray towards the light and see if any object is in the way. Well, that’s a huge shortcut, because transparent materials. Well, why not fix that by taking another huge shortcut, and add a toggle to exclude certain objects from shadow ray casting?