Cones
Okay. Next you’re going to add cones to your ray tracer, and it turns out that cones are remarkably similar to cylinders. A true cone has these features:
- It is infinite in length, just like a cylinder.
- It can be truncated, just like a cylinder.
- It can be closed, just like a cylinder.
And I really do mean just like a cylinder. You may be able to reuse a fair bit of the code you just wrote for cylinders.
Here’s where the challenge ramps up, though—I’m going to take the training wheels off. No hand-holding. No safety nets. Just a bit of explanation, a few tests, and a whole heap of confidence in your ability to do just about anything you put your mind to.
You’re going to implement what is called a double-napped cone, which most folks would ...
Get The Ray Tracer Challenge now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.