Skip to content

Commit

Permalink
Merge pull request #409 from RayTracing/new-figures
Browse files Browse the repository at this point in the history
New figures
  • Loading branch information
hollasch authored Mar 23, 2020
2 parents efec4ff + a47cde7 commit 6b5a788
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
19 changes: 12 additions & 7 deletions books/RayTracingInOneWeekend.html
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,8 @@

![Figure [normal-directions]: Possible directions for sphere surface-normal geometry](../images/fig.normal-possibilities.jpg)

</div>

We need to choose one of these possibilities because we will eventually want to determine which
side of the surface that the ray is coming from. This is important for objects that are rendered
differently on each side, like the text on a two-sided sheet of paper, or for objects that have an
Expand Down Expand Up @@ -883,6 +885,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Listing [hittable-time-side]: <kbd>[hittable.h]</kbd> The hittable class with time and side]

<div class='together'>
And then we add the surface side determination to the class:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
Expand Down Expand Up @@ -1026,7 +1029,7 @@

## Common Constants and Utility Functions

<div class='together'></div>
<div class='together'>
We need some math constants that we conveniently define in their own header file. For now we only
need infinity, but we will also throw our own definition of pi in there, which we will need later.
There is no standard portable definition of pi, so we just define our own constant for it. We'll
Expand Down Expand Up @@ -1360,12 +1363,13 @@
the chapter.)

<div class='together'>
There are two unit radius spheres tangent to the hit point $p$ of a surface. These two spheres
have a center of $(p + N)$ and $(p - N)$, where $N$ is the normal of the surface. The sphere with a
center at $(p - N)$ is considered _inside_ the surface, whereas the sphere with center $(p + N)$ is
considered _outside_ the surface. Select the tangent unit radius sphere that is on the same side of
the surface as the ray origin. Pick a random point $s$ inside this unit radius sphere and send a
ray from the hit point $p$ to the random point $s$:
There are two unit radius spheres tangent to the hit point $p$ of a surface. These two spheres have
a center of $(p + \vec{N})$ and $(p - \vec{N})$, where $\vec{N}$ is the normal of the surface. The
sphere with a center at $(p - \vec{N})$ is considered _inside_ the surface, whereas the sphere with
center $(p + \vec{N})$ is considered _outside_ the surface. Select the tangent unit radius sphere
that is on the same side of the surface as the ray origin. Pick a random point $s$ inside this unit
radius sphere and send a ray from the hit point $p$ to the random point $s$ (this is the vector
$(s-p)$):

![Figure [rand-vector]: Generating a random diffuse bounce ray](../images/fig.rand-vector.jpg)

Expand Down Expand Up @@ -2757,6 +2761,7 @@

- Dave Hart
- Jean Buckley
</div>

<div class="credit-list"> **Web Release**

Expand Down
1 change: 1 addition & 0 deletions books/RayTracingTheNextWeek.html
Original file line number Diff line number Diff line change
Expand Up @@ -2686,6 +2686,7 @@

- Dave Hart
- Jean Buckley
</div>

<div class="credit-list"> **Web Release**

Expand Down
1 change: 1 addition & 0 deletions books/RayTracingTheRestOfYourLife.html
Original file line number Diff line number Diff line change
Expand Up @@ -2364,6 +2364,7 @@

- Dave Hart
- Jean Buckley
</div>

<div class="credit-list"> **Web Release**

Expand Down
Binary file added images/fig.normal-possibilities.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/fig.rand-vector.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b5a788

Please sign in to comment.