|
2326 | 2326 | we say "quadrilateral" here, we're really talking about parallelograms, a specific kind of
|
2327 | 2327 | quadrilateral where opposite sides are parallel. These three entities are
|
2328 | 2328 |
|
2329 |
| -1. $\mathbf{O}$, the lower-left corner of the quadrilateral. |
| 2329 | +1. $\mathbf{Q}$, the lower-left corner of the quadrilateral. |
2330 | 2330 | 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. |
2332 | 2332 | 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. |
2334 | 2334 |
|
2335 | 2335 | These values are three-dimensional, even though a quad itself is a two-dimensional object.
|
2336 | 2336 |
|
|
2341 | 2341 |
|
2342 | 2342 | Finding the Plane That Contains a Given Quadrilateral
|
2343 | 2343 | ------------------------------------------------------
|
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 |
2345 | 2345 | three of these values (and thus the quad itself).
|
2346 | 2346 |
|
2347 | 2347 | Fortunately, this is very simple. Recall that in $Ax + By + Cz = D$, $(A,B,C)$ represents the
|
|
2350 | 2350 | $$ \mathbf{n} = \text{unit_vector}(\mathbf{u} \times \mathbf{v}) $$
|
2351 | 2351 |
|
2352 | 2352 | 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$: |
2354 | 2354 |
|
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 $$ |
2356 | 2356 |
|
2357 | 2357 | We can now use these two values $\mathbf{n}$ and $D$ to find the point of intersection with a given
|
2358 | 2358 | ray and the plane containing the quadrilateral.
|
|
2370 | 2370 | on the plane. We've already been using a coordinate frame for our 3D space -- this is defined by an
|
2371 | 2371 | origin point $\mathbf{O}$ and three basis vectors $\mathbf{x}$, $\mathbf{y}$, and $\mathbf{z}$.
|
2372 | 2372 |
|
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 |
2374 | 2374 | vectors: $\mathbf{u}$ and $\mathbf{v}$. Now normally, you see axes that are perpendicular to each
|
2375 | 2375 | other, so they all meet at 90° angles. However, this doesn't need to be the case in order to span
|
2376 | 2376 | the entire space -- you just need two axes that are not parallel to each other.
|
|
2379 | 2379 |
|
2380 | 2380 | Consider figure [ray-plane] as an example. Ray $\mathbf{R}$ intersects the plane, yielding
|
2381 | 2381 | 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 |
2383 | 2383 | other words, the plane coordinates of intersection point $\mathbf{P}$ is $(1,\frac{1}{2})$.
|
2384 | 2384 |
|
2385 | 2385 | Generally, given some arbitrary point $\mathbf{P}$, we seek two scalar values $\alpha$ and $\beta$,
|
2386 | 2386 | so that
|
2387 | 2387 |
|
2388 |
| - $$ \mathbf{P} = \mathbf{O} + \alpha \mathbf{u} + \beta \mathbf{v} $$ |
| 2388 | + $$ \mathbf{P} = \mathbf{Q} + \alpha \mathbf{u} + \beta \mathbf{v} $$ |
2389 | 2389 |
|
2390 | 2390 | If $\mathbf{u}$ and $\mathbf{v}$ were guaranteed to be orthogonal to each other (forming a 90°
|
2391 | 2391 | angle between them), then this would be a simple matter of projecting $\mathbf{P}$ onto the two
|
2392 | 2392 | basis vectors $\mathbf{u}$ and $\mathbf{v}$. However, since we are not restricting $u$ and $v$ to be
|
2393 | 2393 | perpendicular, and allowing them to form any angle (other than zero), the math's a little bit
|
2394 | 2394 | trickier.
|
2395 | 2395 |
|
2396 |
| -$$ \mathbf{P} = \mathbf{O} + \alpha \mathbf{u} + \beta \mathbf{v}$$ |
| 2396 | +$$ \mathbf{P} = \mathbf{Q} + \alpha \mathbf{u} + \beta \mathbf{v}$$ |
2397 | 2397 |
|
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} $$ |
2399 | 2399 |
|
2400 | 2400 | 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}$. |
2402 | 2402 |
|
2403 | 2403 | Cross the above equation with $\mathbf{u}$ and $\mathbf{v}$, respectively:
|
2404 | 2404 |
|
|
0 commit comments