Innula Zenovka Posted August 30, 2011 Share Posted August 30, 2011 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 More sharing options...
Tabris Daxter Posted August 31, 2011 Share Posted August 31, 2011 Innula Zenovka wrote: What do I do if it's a more complex shape -- a pentagon for example, or even, heaven help us, a pentagram? asking the wrong guy Link to comment Share on other sites More sharing options...
Void Singer Posted August 31, 2011 Share Posted August 31, 2011 I believe that the coordinates should be around the perimeter in order... I can't actually confirm that and the original doesn't say, but the original seems to suggest that (I have some notes about it on the talk page).... Link to comment Share on other sites More sharing options...
Innula Zenovka Posted August 31, 2011 Author Share Posted August 31, 2011 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 More sharing options...
Void Singer Posted August 31, 2011 Share Posted August 31, 2011 as far as I could tell it doesn't matter where you start, as long as you traveled around the edge, and I don't think 0,0 is supposed to be a valid point on the edge.... but if it can be then it need to be the last one I think Link to comment Share on other sites More sharing options...
Recommended Posts
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