O'Rourke Chapter 7: Search & Intersection in PDF - Computer Science
O'Rourke Chapter 7: Search & Intersection in PDF - Computer Science
O'Rourke Chapter 7: Search & Intersection in PDF - Computer Science
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Segment-Triangle <strong>Intersection</strong><br />
• Determ<strong>in</strong>e if qr <strong>in</strong>tersects plane π conta<strong>in</strong><strong>in</strong>g<br />
triangle T.<br />
source: O’Rourke<br />
useful <strong>in</strong> ray trac<strong>in</strong>g<br />
• Let N=(A,B,C) be normal to π<br />
r<br />
π :(x,y,z) •(A,B,C)=D (i.e.π π = Ax + By + Cz = D)<br />
π<br />
c N<br />
• F<strong>in</strong>d normal N us<strong>in</strong>g cross-products <strong>in</strong>volv<strong>in</strong>g a, b, c<br />
p<br />
T<br />
• parameterize qr: p(t) = q + t(r-q)<br />
a b<br />
D − ( q • N)<br />
• solve for t :<br />
t<br />
=<br />
q<br />
( r − q)<br />
• N<br />
• us<strong>in</strong>g t, f<strong>in</strong>d po<strong>in</strong>t of <strong>in</strong>tersection p if it exists<br />
• Classify relationship between p and T<br />
• p is <strong>in</strong> T iff its projection p’ is <strong>in</strong> a projection* T’ of T<br />
to xy, xz or yz-plane<br />
+--<br />
• Barycentric coord<strong>in</strong>ates<br />
“left edge” p’ +-+<br />
• Check results of 3 of tests for with<br />
++respect<br />
to T’: +++ means p’ <strong>in</strong>side T’.<br />
+++<br />
-+- -++<br />
--<br />
* avoid degeneracy by project<strong>in</strong>g out largest coord<strong>in</strong>ate<br />
--+<br />
T’