2

I understand how navigation meshes work but how do I actually create them.

My guess was choosing random vertices with a given set of constraints like, constant z-axis value to make it plane, choose random points which are not less than the minimum specified separation between vertices so that the meshes have a finite area, etc.

As you see I don`t have much knowledge as to how this can be achieved. Creating a navmesh seems more manual to me. What could be an effective way to create convex meshes in a 3D environment?

Kromster
  • 7,181
  • 7
  • 63
  • 111
user3124361
  • 471
  • 5
  • 21

1 Answers1

2

There are number of ways actually.

To outline in few words - get walkable areas contours and use Delaunay triangulation to split them into triangles, adding more points if there are height changes or too big polys.

Check out the RecastNavigation library (source at github), it does generation of NavMesh as a part of it's functionality.

Kromster
  • 7,181
  • 7
  • 63
  • 111
  • thanks a lot for your reply. I have been looking over the RecastNavigation library after you mentioned. What I understood is Recast makes navmeshes and one can use Detour to do the pathfinding. As Recast Demo is an implementation of Recast, can`t recast demo be used to generate a file with data of created navmesh written in it? I can`t find a way to export or save the navmesh created. Or, should I implement the library myself to do the task? – user3124361 Jan 14 '15 at 13:28
  • @user3124361: If you need just the navmesh polys, you can call `duDumpPolyMeshDetailToObj` after navmesh is generated. – Kromster Jan 14 '15 at 13:47