Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New figures #409

Merged
merged 3 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.