Skip to content

Commit 16c7621

Browse files
committed
Rename quad corner point from O to Q.
To distinguish it from the 3D origin.
1 parent a23424e commit 16c7621

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

books/RayTracingTheNextWeek.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,11 +2326,11 @@
23262326
we say "quadrilateral" here, we're really talking about parallelograms, a specific kind of
23272327
quadrilateral where opposite sides are parallel. These three entities are
23282328

2329-
1. $\mathbf{O}$, the lower-left corner of the quadrilateral.
2329+
1. $\mathbf{Q}$, the lower-left corner of the quadrilateral.
23302330
2. $\mathbf{u}$, a vector representing the first side of the quadrilateral.
2331-
$\mathbf{O} + \mathbf{u}$ gives the lower right corner.
2331+
$\mathbf{Q} + \mathbf{u}$ gives the lower right corner.
23322332
3. $\mathbf{v}$, a vector representing the second side of the quadrilateral.
2333-
$\mathbf{O} + \mathbf{v}$ gives the upper left corner.
2333+
$\mathbf{Q} + \mathbf{v}$ gives the upper left corner.
23342334

23352335
These values are three-dimensional, even though a quad itself is a two-dimensional object.
23362336

@@ -2341,7 +2341,7 @@
23412341

23422342
Finding the Plane That Contains a Given Quadrilateral
23432343
------------------------------------------------------
2344-
We have $\mathbf{O}$, $u$, and $v$, and want the corresponding equation of the plane containing all
2344+
We have $\mathbf{Q}$, $u$, and $v$, and want the corresponding equation of the plane containing all
23452345
three of these values (and thus the quad itself).
23462346

23472347
Fortunately, this is very simple. Recall that in $Ax + By + Cz = D$, $(A,B,C)$ represents the
@@ -2350,9 +2350,9 @@
23502350
$$ \mathbf{n} = \text{unit_vector}(\mathbf{u} \times \mathbf{v}) $$
23512351

23522352
The plane is defined as all points $(x,y,z)$ that satisfy the equation $Ax + By + Cz = D$. Well, we
2353-
know that $\mathbf{O}$ lies on the plane, so we can use that to find $D$:
2353+
know that $\mathbf{Q}$ lies on the plane, so we can use that to find $D$:
23542354

2355-
$$ D = \mathbf{n}_x\mathbf{O}_x + \mathbf{n}_y\mathbf{O}_y + \mathbf{n}_z\mathbf{O}_z $$
2355+
$$ D = \mathbf{n}_x\mathbf{Q}_x + \mathbf{n}_y\mathbf{Q}_y + \mathbf{n}_z\mathbf{Q}_z $$
23562356

23572357
We can now use these two values $\mathbf{n}$ and $D$ to find the point of intersection with a given
23582358
ray and the plane containing the quadrilateral.
@@ -2370,7 +2370,7 @@
23702370
on the plane. We've already been using a coordinate frame for our 3D space -- this is defined by an
23712371
origin point $\mathbf{O}$ and three basis vectors $\mathbf{x}$, $\mathbf{y}$, and $\mathbf{z}$.
23722372

2373-
Since a plane is a 2D construct, we just need a plane origin point $\mathbf{O}$ and _two_ basis
2373+
Since a plane is a 2D construct, we just need a plane origin point $\mathbf{Q}$ and _two_ basis
23742374
vectors: $\mathbf{u}$ and $\mathbf{v}$. Now normally, you see axes that are perpendicular to each
23752375
other, so they all meet at 90° angles. However, this doesn't need to be the case in order to span
23762376
the entire space -- you just need two axes that are not parallel to each other.
@@ -2379,26 +2379,26 @@
23792379

23802380
Consider figure [ray-plane] as an example. Ray $\mathbf{R}$ intersects the plane, yielding
23812381
intersection point $\mathbf{P}$. Measuring against plane vectors $\mathbf{u}$ and $\mathbf{v}$, the
2382-
intersection point $\mathbf{P}$ is at $\mathbf{O} + (1)\mathbf{u} + (\frac{1}{2})\mathbf{v}$. In
2382+
intersection point $\mathbf{P}$ is at $\mathbf{Q} + (1)\mathbf{u} + (\frac{1}{2})\mathbf{v}$. In
23832383
other words, the plane coordinates of intersection point $\mathbf{P}$ is $(1,\frac{1}{2})$.
23842384

23852385
Generally, given some arbitrary point $\mathbf{P}$, we seek two scalar values $\alpha$ and $\beta$,
23862386
so that
23872387

2388-
$$ \mathbf{P} = \mathbf{O} + \alpha \mathbf{u} + \beta \mathbf{v} $$
2388+
$$ \mathbf{P} = \mathbf{Q} + \alpha \mathbf{u} + \beta \mathbf{v} $$
23892389

23902390
If $\mathbf{u}$ and $\mathbf{v}$ were guaranteed to be orthogonal to each other (forming a 90°
23912391
angle between them), then this would be a simple matter of projecting $\mathbf{P}$ onto the two
23922392
basis vectors $\mathbf{u}$ and $\mathbf{v}$. However, since we are not restricting $u$ and $v$ to be
23932393
perpendicular, and allowing them to form any angle (other than zero), the math's a little bit
23942394
trickier.
23952395

2396-
$$ \mathbf{P} = \mathbf{O} + \alpha \mathbf{u} + \beta \mathbf{v}$$
2396+
$$ \mathbf{P} = \mathbf{Q} + \alpha \mathbf{u} + \beta \mathbf{v}$$
23972397

2398-
$$ \mathbf{p} = \mathbf{P} - \mathbf{O} = \alpha \mathbf{u} + \beta \mathbf{v} $$
2398+
$$ \mathbf{p} = \mathbf{P} - \mathbf{Q} = \alpha \mathbf{u} + \beta \mathbf{v} $$
23992399

24002400
Here, $\mathbf{P}$ is the _point_ of intersection, and $\mathbf{p}$ is the _vector_ from
2401-
$\mathbf{O}$ to $\mathbf{P}$.
2401+
$\mathbf{Q}$ to $\mathbf{P}$.
24022402

24032403
Cross the above equation with $\mathbf{u}$ and $\mathbf{v}$, respectively:
24042404

images/fig-2.05-quad-def.jpg

508 Bytes
Loading

images/fig-2.06-ray-plane.jpg

13.5 KB
Loading

images/fig-2.07-quad-coords.jpg

-294 Bytes
Loading

0 commit comments

Comments
 (0)