For this image, I am trying to define a shape for each "territory". How would I accomplish doing this?
I'm not sure how you want to implement, but this generic approach should work:
Hopefully you can define the shapes of your territories as a series of points - ie (x1, y1), (x2, y2), etc, then you can use one of the hit testing algorithms defined here: How can I determine whether a 2D Point is within a Polygon? (several great answers there, general enough that you could adapt the concepts to fit your needs).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.