Can concave polygons be used in pathfinding?

Started by
3 comments, last by lucky6969b 9 years, 7 months ago

My apologies first if I say something silly because I am no graphic expert,

I am just a programmer. Most of the times I heard about the

usages of convex polygons which are plenty.

But can a concave polygon be used in the pathfinding process?

Thanks Jack

Advertisement


Most of the times I heard about the

usages of convex polygons which are plenty.

But can a concave polygon be used in the pathfinding process?

You can use both of them in both fields, AI and graphics. The reason for using primary convex polygons is, that if you have a convex polygon, then the whole matter of calculating stuff gets a lot easier and faster and that you suddenly get some knowledge for free (eg. in a convex polygon you know that whatever two points you choose, the can be connected by a line without hitting the boundary of the polygon, which is good to know if you want to navigate an AI entity on top of a polygon, aka nav-mesh).

With this in mind, it is often better to subdivide your concave polygons into convex polygons and to use the easy stuff smile.png

Hello Ashaman73,

Thank you for clearing up my doubts,

I asked this question because I suddenly think of this thing that might or might not work.

Originally I have several navmeshes with different radii, I want to use them for cooperative pathfinding as an alternative

to steering.

Now I'd like to calculate the intersection between these navmeshes, if navmesh A, B and C intersect, then they can

cooperatively path find, if just A and B intersect, agent C can ignore the other 2 agents, and A and B can continue

to cooperative pathfind. I've found a library actually which does this, but the caveat is the results may be concave.

https://sourceforge.net/projects/polyclipping/files/clipper_ver6.1.3a.zip/stats/map

How do you call a process which turns a concave poly into a convex poly? Triangulation is not the word?

What is your opinion?

Thanks

Jack

It's called convex decomposition, and apparently there are quite a few papers on the topic. Most are probably more complex than what you need.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

Thank you Promit!

This topic is closed to new replies.

Advertisement