Skip to content

Commit bd387e8

Browse files
rupsishollasch
authored andcommitted
Book 1 Updates 2
1 parent ea3754c commit bd387e8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,9 +2964,6 @@
29642964
inline vec3 reflect(const vec3& v, const vec3& n) {
29652965
return v - 2*dot(v,n)*n;
29662966
}
2967-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
2968-
2969-
...
29702967
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29712968
[Listing [vec3-reflect]: <kbd>[vec3.h]</kbd> vec3 reflection function]
29722969

@@ -3180,8 +3177,8 @@
31803177

31813178
The amount that a refracted ray bends is determined by the material's _refractive index_. Generally,
31823179
this is a single value that describes how much light bends when entering a material from a vacuum.
3183-
Glass has a refractive index of something like 1.5&ndash;1.7, and air has a small refractive index
3184-
of 1.000293.
3180+
Glass has a refractive index of something like 1.5&ndash;1.7, diamond is around 2.4, and air has a
3181+
small refractive index of 1.000293.
31853182

31863183
When a transparent material is embedded in a different transparent material, you can describe the
31873184
refraction with a relative refraction index: the refractive index of the object's material divided
@@ -3213,8 +3210,7 @@
32133210
$$ \eta \cdot \sin\theta = \eta' \cdot \sin\theta' $$
32143211

32153212
Where $\theta$ and $\theta'$ are the angles from the normal, and $\eta$ and $\eta'$ (pronounced
3216-
"eta" and "eta prime") are the refractive indices (typically air = 1.0, glass = 1.3–1.7, diamond =
3217-
2.4). The geometry is:
3213+
"eta" and "eta prime") are the refractive indices. The geometry is:
32183214

32193215
![Figure [refraction]: Ray refraction](../images/fig-1.17-refraction.jpg)
32203216

@@ -3971,6 +3967,8 @@
39713967
`random_in_unit_sphere()`, just for two dimensions.
39723968

39733969
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
3970+
...
3971+
39743972
inline vec3 unit_vector(const vec3& u) {
39753973
return v / v.length();
39763974
}
@@ -3984,6 +3982,9 @@
39843982
return p;
39853983
}
39863984
}
3985+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
3986+
3987+
...
39873988
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39883989
[Listing [rand-in-unit-disk]: <kbd>[vec3.h]</kbd> Generate random point inside unit disk]
39893990

0 commit comments

Comments
 (0)