Why can't I use this glb as Yuka navigation mesh

I’m interested in exploring Yuka for some fun ideas. I am trying to use the basic navmesh demo to get learning with the VSCode Live Server recommended in its docs

The whole tab is hard locking and never coming back when I try to change the nav mesh loaded to https://testasset.s3.amazonaws.com/casual_collision.glb wether remote or local. I see it downloading successfully in network tab.

No feedback in the console, wondering if any of the Yuka experts have some idea why

@labris and @roland are the best people to ask :smiley:

2 Likes

I’ll check asap a bit later :slight_smile:

1 Like

Probably your GLTF asset contains rendering primitives other than TRIANGLES (.e.g. POINTS, LINES etc.). YUKA.NavMeshLoader makes the assumption that its geometry data are only defined with triangles.
Also, try to use not GLB but GLTF+.bin files.
A bit more info is here - How to correctly export a NavMesh from Blender 2.8 · Issue #9 · Mugen87/yuka · GitHub

2 Likes

Hi!

Your mesh has overlapping vertices/edges.

For example this one:

Here is the proof. After moving the vertice you get this:

How to solve:
First of all select all vertices in edit mode, press RMB, select Merge Vertice By Distance:

image

Try to play with the Merge Distance so you have not lost any of your visible vertices.

Remove the extra triangles so your mesh looks like this:
image

In the last step Disolve the unneeded vertices:

image

In Edge mode select all edges (shortcut ‘A’):

Press ‘F’ to create an N-gon:

Export to GLB.

I’ve tried to use this technique on the lower part of the navmesh and YUKA was able to load it.

Cheers!

R.

:vulcan_salute:

1 Like

Partial success :slight_smile:

Thanks for the detailed instructions. We had some partial success trying a small segment with what you outlined:

https://testasset.s3.amazonaws.com/casual_collision11.glb

it loads but performance is visibly impacted moving the camera around on a macbook pro. Trying to do it to the entire space, never ends up loading.

I looked at the advanced navmesh example glb and there is a lot going on there and loads quickly and silky smooth. So must be some rule we are violating :confused:

So, my I’ve removed the EDIT that the approach is not working and the navmesh is not visible from my first answer becuase I’ve exported the GLB without any faces that’s why I couldn’t see the colored navmesh. The funny thing here is that YUKA seems to be not requiring any faces in the navmesh.

The performance degradation comes from the graph helper. Try to comment it out and it will be speedy again:
image

1 Like

Yup that sure did! Thanks again

1 Like

So actually there is nothing wrong with the navmesh itself :slight_smile: however I would recommend to merge by distance the duplicated vertices.

1 Like

Hi guys!

@br-matt @labris

I’ve changed the GraphHelper.js so now it is using the LineSystem instead of multiple Lines so the performance issue is gone.

2 Likes

Thanks again! Yes, even the original mesh works now with the helper on but will stick to merging verts like you suggested :slight_smile:

1 Like

Fell free to commit a PR with your case, each example could help other people to get some knowledge :slight_smile:

Will do! Once its further along and can figure out some mock data that does not depend on our APIs

1 Like