HomeTable of Contents Gallery Sample Chapter Downloads Courses Links Contact Mailing List Web Slaves
Errata

Errors

You can download the latest list of errata here.

Page Errors
xvi In the Pathways through This Book section, paragraph 3, line 2: remove "Although".
11 The code statement
mattePtr->set_cd(RGBColor(r, g, b));

should be
matte_ptr->set_cd(RGBColor(r, g, b));

The code statement
void
MattePtr::set_cd(const float r, const float g, const float b);

should be
void
Matte::set_cd(const float r, const float g, const float b);

The code statement
mattePtr->set_cd(r, g, b);

should be
matte_ptr->set_cd(r, g, b);
53 The assignment operator should be removed from the ShadeRec class declaration in Listing 3.3, because the ShadeRec class doesn't have an assignment operator. See the discussion on page 54.
76 The first paragraph of the Notes and Discussion section refers to filtering code in Chapter 4, but there is no filtering code in Chapter 4, or anywhere else in the book.
106 There is a missing "}" after the inner for loop in Listing 5.10.
180 Question 10.4 should state that Figure 10.13 was rendered with one regular lens
143 The Listing 8.1 caption should read World::render_perspective instead of World::renderScene.
145 The images in Figure 8.19 are old versions. The correct versions are in the ray traced images and Chapter 8 downloads. These are the same objects that appear in Figure 8.16.
184 In the footnote, y0 should be yn.
190 Figure 11.8(c) was rendered with fov = 200 degrees, not fov = 100 degrees as stated in the caption.
239 Section 13.11.2 Importance Sampling should be numbered 13.11.3.
261 The ShadeRec declaration in Listing 14.6 is missing the ray parameter data member: double t. This is assigned in Listing 14.8, but only used to simulate colored transparency in Chapter 24. Listing 14.6 is also missing the destructor declaration: ~ShadeRec(void);.

The two ShadeRec constructors in Listing 14.7 are missing the color data member, which is used in Chapter 3.

266 The Figure 14.15 caption should state that from left to right: kd = 0.1, 0.4, 0.7, 1.0.
273 The first line after Listing 14.15 should state that the light is 1.5 times as bright as in Figure 14.22(a), not twice as bright.
277 In the expression for L in Exercise 14.5, "b" should be "ls".
301 The last line before Figure 16.9 states that Figure 16.9 is the same as ... It should be Figure 16.9(a).
312 312 The last data member in the AmbientOccluder class declaration is RGBColor min_amount;. This is incorrect, and needs to be replaced with:

float ls;
RGBColor color;
float min_amount;
319 The images in Figure 17.8 are incorrect. The correct images are in the RayTracedImages.zip download, and the Chapter17.zip download.
333 In line 5 of the second last paragraph, there should be a "the" before the first "area".
342 The in_shadow function in Listing 18.14 should be declared virtual.
349 Question 18.3 should be: How do directional and point lights work without modification with the area_light_shade functions?
351 Exercise 18.4 should ask you to use the Figures in Section 18.9 to test your implementation, not Section 18.7.
371 In the second paragraph, the Rectangle data member names a_lenSquared and b_lenSquared should be a_len_squared and b_len_squared respectively.
386 In Listing 19.11, the "const" should be removed from add_object(const GeometricObject* object_ptr). (const pointer arguments generate a compiler warning on my system, but still work).
387 In Listing 19.13, the const should be removed from the Compound::set_material function.
394 In the code fragment, OpenCylinder::set_bottom_material should be SolidCylinder::set_bottom_material, and the const should be removed.
441 In Question 21.12, the statement on line 5 that "there's not a huge choice of numbers to pick from" needs to be qualified. If we allow the angular range of the wedges to be less than one degree, there's actually an infinite number of choices. For example, if each wedge is half a degree wide, there will be 720 of them in a ring. If we want the wedges in Figure 21.17 to look attractive, for example, not too narrow, then there is a limited choice of numbers.
466 In Listing 22.9, shadow_hitt should be shadow_hit. To be consistent with other class declarations, this should also be declared after the hit function declaration.
472 The same image has been used for all parts of Figure 22.18. The correct images are in the RayTracedImages.zip download, and the Chapter22.zip download.
636 The third line of Question 28.16 states that the top halves of the spheres are yellow. They are actually orange.
669 The URL in the Figure 29.27 caption should be http://www.lfgrafix.com. The link on the Links page is correct.

Typographic matters

Page Errors
74 In Listing 3.15, blank lines should be removed from the function declarations World::build and World::render_scene.
277 In Question 14.3, World::hit_objects should be larger.
342 The two Π's in the double integral upper bounds should not be italic.
343 There should be a space after "return" in Listing 18.16.
370 The code in Listing 19.8 is too indented and the first three return statements have an extra tab.
435 The last sentence in the second paragraph: "The beveled wedge class is on the book's website." should be removed because this statement is repeated at the top of page 436.
660 In Listing 29.10, the three statements that set ka, kd, and cd for the sv_matte_ptr material have a space before the ->. These spaces should be removed.

There are a number of other extra spaces in this listing.

Doubles and floats

The ray tracer uses doubles for intersection calculations and floats for shading, but a number of code examples use floats where they should use doubles. These are mainly the "t" or "tmin" parameters of hit and shadow_hit functions, local variables in these functions, and physical parameters of geometric objects. All code currently available on the website, or to be placed on the website, is written consistently.

The following is a list of affected code examples where floats should be replaced by doubles.

Listing Errors
Listing 14.4 The tmin parameter in the World::hit_objects function declaration
Listing 14.8 The local variables t and tmin in the World::hit_objects function
Listing 14.9 The tmin parameter in the Tracer::trace_ray function declaration
Listing 16.3 The tmin parameter and the local variable t in the Plane::shadow_hit function
Listing 19.7 The local variable t in the Disk::hit function
Listing 19.8 Three local variables in the Rectangle::hit function
Listing 19.12 The local variable t in the Compound::hit function
Listing 19.14 All six floats
Listing 21.4 The local variable t in the Plane::hit function
Listing 21.6 The t parameter in the Instance::hit function
Listing 21.9 All four parameters of the BeveledCylinder constructor
Listing 22.1 The tmin parameter in the Grid::hit and Grid::shadow_hit function declarations
Listing 22.3 All three parameters of the function clamp
Listing 22.6 All four floats
Listing 22.8 The local variables volume and radius in the World::build function. Also, 3.14159 should be PI, and there should be more decimal points in 0.333333. None of these changes will affect the computations because the radius will be cast to a double when it's stored in the sphere.
Listing 22.9 All five floats
Listing 22.10 All three parameters of the function Instance::translate
Listing 23.3 The tmin parameter of the FlatMeshTriangle::hit function
Listing 28.3 The local variable t in the Dielectric::shade function
Listing 28.4 The parameter tmin of the Whitted::trace_ray function
Listing 29.12

The parameter tmin of  the SmoothMeshTriangle::hit function