Notice that the ground can be setEnabled(false) and it still works. Cool.
Anyway, I increased the ground size to 16x16 at SOME point in my playing. The navver is definitely using the ground size as a factor⌠placing many of its points along the outer edges.
Just for fun, I thought I would randomize the edges of the ground a bit⌠see what fun it offered. https://www.babylonjs-playground.com/#YQHA24#3 Re-run often, for varying ground shapes.
Indeed I did. Have edited them in. In fact I am getting so good at forgetting to put links in that I have been asked to try out for the Olympic Team GB missing links squad
Without the ground mesh, you can have navmesh on the top of the sphere and top of the box if you decrease the cell size. Otherwise, Recast canât voxelize enough to âseeâ those polygons.
see https://www.babylonjs-playground.com/#YQHA24#4
where I set cs and ch values to 0.05
It seems that there is an awful lot I do not understand. I cannot get my head around how the list of meshes form the navmesh, which create the vertices and which remove the vertices for a start.
The navmesh creation internals looks like that (simplified)
gather all the faces from all the mesh set as parameters
eliminates faces whose slope is higher than the parameters
generate a voxel (depending on mesh size and cs/ch parameters this can take a lot of memory and cpu time)
get all positions from the voxel where a virtual agent can go (climb height, radius,âŚ)
from all those positions, compute a mesh ( basically quads)
simplify the mesh and compute connections between the triangles
So, the navmesh youâll get will never fit exactly with the faces/positions you give. Itâs an approximation. The good side is that you can provide multimillion face meshes and get a simplified version with quick access for path finding.
The bad side is you need some learning curve to know how to tweak the navmesh creation parameters go get a good result for what you need.
@Cedric does this naveMesh work for my sation How to create a path root like google maps Iâm waiting or ur merging.
I tried with a* algoritm but I find difficultes in the implemnetation in 3d.
does the solution of agents will draw a logical path between two point for example :
if I want to go from point A which is âtechnical localâ in level 1 to âexit doorâ level 3, does it give me a logical path like a human behavior
Hi @Anes
I did some test with your station and I was able to make agent move around with a displayed line for path. It needs more iteration between making meshes more compliant/more simple for the navmesh creation (stairs) and some tweaking but it works depending on your needs.
Trigger the navmesh creation by changing the walkableSlopeAngle to 46 then click anywhere on the debug navmesh to move agents and see the predicted navigation path.
Let me know if you need some explanation on a more specific part
@Cedric thank u for ur effort,
the problem is that I need just to draw a âcurvingâ paths (logical path) for example if I want to go from the level 1 to level 3, well the path should be on the left of the quai then the stair then the escalator ⌠etc like reality path, not lines passing through train rails
@Cedric and how about level if I add levels to navemesh does it work ?
here for example, if I select the point where the escalator there is no given path
You can have navmesh with multiple levels depending on the navmesh parameters (walkable height and walkable climb). You may have to tweak the source meshes or, at least do a first pas on limiting the meshes used to compute the navmesh. I didnât get good results when I pushed all the meshes from your station. I would list only the meshes I need and tweak the mavmesh parameters until I get something good.