Extract OBJ from navmesh '.bin' files?

365 views
Skip to first unread message

Patrick Pineda

unread,
Oct 11, 2022, 1:42:45 PM10/11/22
to recastnavigation
I'm using recastjs (https://www.npmjs.com/package/recastjs) to generate .bin files... I'm wondering if there's an existing resource on how to parse the generated .bin and export in a format like an OBJ?

Graham Pentheny

unread,
Oct 12, 2022, 2:26:44 AM10/12/22
to recastnavigation

I'm not sure what recasts is doing to generate those bins, but I assume it's something similar to how RecastDemo saves navmesh data. This is a pretty simple file structure.  It's just a header containing general info for the navmesh, followed by one or more sections for each tile containing a header and a data block.

You might want to contact the maintainers of recastjs (or check their source) for more specifics about what they're specifically generating and how.

Vincent Lark

unread,
Oct 12, 2022, 2:58:40 AM10/12/22
to recastna...@googlegroups.com
Lazy maintainer of recastjs here.

Yes, that's exactly it. It mimics Sample::saveAll()
 

--

---
You received this message because you are subscribed to the Google Groups "recastnavigation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to recastnavigati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/recastnavigation/90dc46fa-c81c-4976-a265-3b22273f51e4n%40googlegroups.com.


--
 Vincent LARK

Patrick Pineda

unread,
Oct 17, 2022, 5:20:49 PM10/17/22
to recastnavigation
Hey vincent, thanks for responding. I have to admit that looking at source, this is all a bit alien to me. I'd like to get polygon data out of recastJS somehow, is there a preferred way to do this?

Vincent Lark

unread,
Oct 18, 2022, 3:11:00 AM10/18/22
to recastna...@googlegroups.com
So just to be sure I understand, you'd like to read the .bin file to extract the navigation mesh details, in an .obj format, in Javascript ?

The .bin file file is basically a list of dtMeshTiles
I'm not 100% sure you can extract viewable 3D objects from that structure (can someone confirm ?)

But if so, you would need to read that .bin file and extract the structs by reading their inner components, using DataView directly or a helper library like construct-js

Best of luck !




--
 Vincent LARK

Patrick Pineda

unread,
Nov 23, 2022, 1:34:13 PM11/23/22
to recastnavigation
Hey, just following this up again. I Got a working solution from recastjs, so this is great! 
It does however appear that meshes generated using RecastJS use Monotone Partitioning. Is there a way to update this to use Watershed?

Reply all
Reply to author
Forward
0 new messages