Find isolated polygon

Blitz3D Forums/Blitz3D Programming/Find isolated polygon

aCiD2(Posted 2004) [#1]
Im pretty clueless how to do this, i cant compeltly focus on Blitz atm, which is odd i keep getting distracted :) Anyway, though tsomeone might have an idea. I need to find out if a vertex is in either of these polies, and which one its in... Im not totally sure how the polies will be defined but if someone can make something that can find out what poly a vert is in that'll be great.




Bot Builder(Posted 2004) [#2]
The usual way of doing this is to have a ray come off the vertex in an arbitrary direction (doesn't matter which). Count the number of lines intersected in each poly. If the number is none or even it is not in the polygon, but if its odd, it is in the polygon. For a closed polygon this will always work.

http://freespace.virgin.net/hugo.elias/graphics/x_polyd.htm