views:

44

answers:

2

Hi, I need to know how to determine fast if line intersects simple polygon. It should work in O(log n) time, where n is number of polygon's vertexes. I searched in google, but I didn't find anything useful, maybe I'm blind. ;) Edit: I'm using C++ but I think language isn't a problem, and it isn't homework, just doing some algorithms training. Geometry is sick. ;) Oh. I forgot it's only in 2d. Thanks for future and actual help.

A: 

http://en.wikipedia.org/wiki/Intersection_of_a_polyhedron_with_a_line may lead you to an answer

Martijn
A: 

I've found a paper who solves this problem really fast:

"Fast MinimumStorage RayTriangle Intersection"

http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf

EDIT: It even contains code :)

Bigbohne