Chapter 3

Bare-Bones Ray Tracing

image

Objectives

By the end of this chapter, you should:

  • understand how ray casting works;
  • know how rays are defined;
  • know how to intersect a ray with a plane and a sphere;
  • understand the structure of a simple ray tracer;
  • have implemented a ray tracer that can render orthographic views of an arbitrary number of planes and spheres.

The purpose of this chapter is to explain how a number of ray-tracing processes work in a simplified context. I’ll discuss here how ray tracing generates images, how rays are defined, how ray-object intersections work, the classes required for a simple ray tracer, and how to ray trace an ...

Get Ray Tracing from the Ground Up 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.