Jump to content

isPointInPolygon2D Question


Innula Zenovka
 Share

You are about to reply to a thread that has been inactive for 4634 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'm trying to get a handle on the order in which I need to give the vector coordinates for IsPointInPolygon2D.   As far as I can make out, if the area is vaguely rectangular, I need to go bottom left, top left, top right, bottom right ([<1,1,0>, <1,2,0>, <2,2,0>, <2,1,0>] in the wiki example).  

What do I do if it's a more complex shape -- a pentagon for example, or even, heaven help us, a pentagram?

Link to comment
Share on other sites

Thanks, Void.   I've now looked at what you say on the talk page.    Did your tests suggest  whether it matters where the list starts on the border of the shape, or can I start anywhere and join up the points in the expected order?   (I can test it myself, of course, but I won't bother making lots of textures if the answer's aleady known).

I'm making something for an RP sim, for which I need to know where people are when various things happen.   Dividing the land into parcels isn't really practicable, not least because I've got some rather odd shapes with which to deal.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4634 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...