Download my all code i have load obj file which contain zones and then load android-animation.js which contain model.
for now model is walking on obj(zones one by one) n its working fine no changes required on it but i want to create suppose model currently stand on zone0 and then data will change n it get zone10 so how can model get nearest path.
Its to complex to explain here may be still i tried my best. if you have any query let me know.
If you are not familiar with pathfinding algorithms and the corresponding data structures, you should not implement this by yourself. I suggest to change your application code in order to use something like three-pathfinding or PatrolJS. Otherwise you have to take the time to study the respective topics.
@Mugen87 did you check my files? pathfinder maybe works with .js file not .obj file. i also tried to convert obj file to js format using python script. but paths not create straight it live zig zag because of zones.
I’ve checked your code and see that you are using three-pathfinding. I can also see the mentioned zig zag lines.
Unfortunately, this is not a three.js related issue and i can’t explain to you why this happens. I suggest to open an issue at the github repo of three-pathfinding. Or maybe @donmccurdy can have a look at this here.
The file format should not matter, assuming the geometry is intact… unfortunately there seem to be some issues with your navmesh geometry, the triangulation has not happened correctly:
Each square along the path is a separate mesh, containing 4 triangles, and 2 triangles are stacked on top of the other 2. The navmesh should all be one single mesh, with continuously connected triangles.
If you could share the original file you used to create this navmesh I can help more.
i was created this mesh with https://threejs.org/editor/ and i have already attached full project in google drive and .obj file path is obj/new/model.obj .
if you need any another format let me know i will upload it.
unfortunately i can’t upload file here as i am new user.
It looks like you’ve created the model by lining up Box objects and making them very flat. Unfortunately that’s simply not going to give you a valid navigation mesh, because the boxes are not connected in the geometry itself, and there are lots of extra triangles. You’ll need to use software like Blender, SketchUp, or similar to create a single continuous surface if you want to make the navigation mesh by hand. Or you can create a scene in any tool, and then use Blender to generate a navigation mesh from that scene. I’ve written a blog post explaining how to do that here: https://www.donmccurdy.com/2017/08/20/creating-a-nav-mesh-for-a-webvr-scene/