2D visibility algorithm? (update)

Started by
19 comments, last by Zakwayda 14 years, 7 months ago
Quote:Overall, it works pretty much like you suggested. (I think - dont want to put words in your mouth). For each vertex, I test if it is visible, and if it is, I extend a ray from the eye, through the vertex, back until the next intersection, until the new vertex is no longer visible. Then move on to the next vertex in a counterclockwise (or clockwise) order, adding the successful points to the visible polygon. The tricky stuff comes in when deciding if these extended vertices are really visible or not, and cases where lines are parallel, or lines intersect polygons exactly on another vertex, and mathematical precision issues.
This is probably kind of irrelevant (since you already have a working implementation), but I'll mention again that if you represent the environment using a constrained Delaunay triangulation, the process of building the visibility region corresponding to a point becomes fairly straightforward. It also sounds like there might be fewer precision issues to contend with when using the CDT approach.

The CDT approach is also quite efficient, as it doesn't involve any visibility tests (per se).

Again, this is probably irrelevant at this point, but I just thought I'd mention the CDT method again as a possible alternative approach to the problem.

This topic is closed to new replies.

Advertisement