3d Navigation w/ Yuka.js (1st attempt)



This playground demonstrates a first attempt at getting the Yuka.js NavMesh class working on a non-flat 3d terrain. In this example the terrain being used is the surface of a tree-trunk and it’s branches.

You’ll notice in the code, there’s a function called connectNodes (being used at lines 108-128), and it is used to literally patch the navMesh.graph with the missing graph edges necessary to allow navigation from any of the branches back to the main tree-trunk.

Currently the best navigation is achieved by first selecting a point on the surface of the tree trunk near the branch you want to travel to, allow the cone to travel to that position first and then click somewhere on the branch. Otherwise the path generator is prone to generating unrealistic paths.

I realize this is pretty hacky, but you’ve gotta start somewhere! I’m also really hoping that people smarter than me will chime in :smiley:

I wanted to note that I borrowed a bunch of code from @labris/@roland 's examples, it was extremely helpful.


Nice !!!

1 Like

That’s super cool! :smiley:

1 Like

Unfortunatelly the PG didn’t load for me :frowning:

1 Like

Oh weird, it was loading for me before :open_mouth: Maybe a server problem?


@roland @carolhmj that’s my bad :confused: Ive been switching the urls around for different buckets. I really need to start hosting everything for useful playgrounds over to a github.io endpoint.

This pg should work:

Please let me know if it doesn’t