Skip to content

Commit 7a396c0

Browse files
authored
Merge pull request #771 from RayTracing/negative_t
Brief explanation about negative t values
2 parents 1f50cce + 71c3ef7 commit 7a396c0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Change Log -- Ray Tracing in One Weekend
1111
- Fix: Synchronize copies of `hittable_list.h`, `material.h`, `sphere.h`
1212

1313
### In One Weekend
14+
- Change: Wrote brief explanation waving away negative t values in initial normal sphere
1415
- Fix: Catch cases where `lambertian::scatter()` yields degenerate scatter rays (#619)
1516

1617
### The Next Week

books/RayTracingInOneWeekend.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,9 +725,10 @@
725725
visualize the normals with a color map. A common trick used for visualizing normals (because it’s
726726
easy and somewhat intuitive to assume $\mathbf{n}$ is a unit length vector -- so each
727727
component is between -1 and 1) is to map each component to the interval from 0 to 1, and then map
728-
x/y/z to r/g/b. For the normal, we need the hit point, not just whether we hit or not. Let’s assume
729-
the closest hit point (smallest $t$). These changes in the code let us compute and visualize
730-
$\mathbf{n}$:
728+
x/y/z to r/g/b. For the normal, we need the hit point, not just whether we hit or not. We only have
729+
one sphere in the scene, and it's directly in front of the camera, so we won't worry about negative
730+
values of $t$ yet. We'll just assume the closest hit point (smallest $t$). These changes in the code
731+
let us compute and visualize $\mathbf{n}$:
731732

732733
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
733734
double hit_sphere(const point3& center, double radius, const ray& r) {

0 commit comments

Comments
 (0)