Skip to content

Commit 6b5a788

Browse files
authored
Merge pull request #409 from RayTracing/new-figures
New figures
2 parents efec4ff + a47cde7 commit 6b5a788

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,8 @@
802802

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

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

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

888891
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
@@ -1026,7 +1029,7 @@
10261029

10271030
## Common Constants and Utility Functions
10281031

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

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

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

@@ -2757,6 +2761,7 @@
27572761

27582762
- Dave Hart
27592763
- Jean Buckley
2764+
</div>
27602765

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

books/RayTracingTheNextWeek.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,6 +2686,7 @@
26862686

26872687
- Dave Hart
26882688
- Jean Buckley
2689+
</div>
26892690

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

books/RayTracingTheRestOfYourLife.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,6 +2364,7 @@
23642364

23652365
- Dave Hart
23662366
- Jean Buckley
2367+
</div>
23672368

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

images/fig.normal-possibilities.jpg

62.3 KB
Loading

images/fig.rand-vector.jpg

75.1 KB
Loading

0 commit comments

Comments
 (0)