AS3: Random Point on Irregular Shape
问题 I have a MovieClip holding an irregular shape such as this one: I need to generate a random point on this shape. I can use brute force by generating points within the bounding box and then hitTesting to see if they reside on the irregular shape. However, I'm sure there's a more efficient way to tackle this problem. What is the most efficient way to generate a random point on an irregular shape? 回答1: You mentioned hitTest, but I assume you meant hitTestPoint(). If so, a function go get the