Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于这张图片,我试图为每个“领土”定义一个形状。我将如何做到这一点?
我不确定你想如何实现,但这种通用方法应该有效:
希望您可以将您的区域的形状定义为一系列点 - 即 (x1, y1)、(x2, y2) 等,然后您可以使用此处定义的命中测试算法之一:我如何确定是否为 2D点在多边形内?(那里有几个很好的答案,足够笼统,您可以调整这些概念以满足您的需求)。