07.01.2015 Views

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

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• W<strong>in</strong>d<strong>in</strong>g number<br />

generalizes to 3D<br />

Po<strong>in</strong>t <strong>in</strong> Polyhedron<br />

• uses solid angle<br />

(fraction of sphere surface<br />

used by cone at po<strong>in</strong>t)<br />

• Ray cross<strong>in</strong>g<br />

generalizes to 3D<br />

• q <strong>in</strong>side P if odd<br />

number of<br />

cross<strong>in</strong>gs<br />

• q outside P if even<br />

number of<br />

cross<strong>in</strong>gs<br />

Runn<strong>in</strong>g Time<br />

(see next slide)<br />

P<br />

q<br />

r<br />

Assume each face is a triangle.<br />

Algorithm: : POINT <strong>in</strong> POLYHEDRON (P, R, q)<br />

Compute bound<strong>in</strong>g radius R<br />

loop forever<br />

r 0 = random ray of length R<br />

r=q+r<br />

r 0<br />

cross<strong>in</strong>gs = 0<br />

for each triangle T of polyhedron P do<br />

SegTriInt(T, q, r)<br />

if degenerate <strong>in</strong>tersection<br />

then go back to loop<br />

else <strong>in</strong>crement cross<strong>in</strong>gs appropriately<br />

if cross<strong>in</strong>gs odd<br />

then q is <strong>in</strong>side P<br />

else q is outside P<br />

Exit<br />

source: O’Rourke

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!