How to get the positions and indices of a list of meshes? #1170
-
Hello! I am attempting to process a GLTF to get two buffers, one that has the positions of all the meshes joined and another that is the indices for this position buffer. The intent is to feed this into recast to get a navmesh generated on a Node server. Could you help point me in the right direction? So far I have discovered that I can get an array of all the meshes, then their primitives, then search the primitives for a position attribute. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
A good starting point might be:
Untested code, but it should be something like:
There are a few additional things you may need to consider. If the mesh data is quantized and your navmesh generator can't handle that, consider using the dequantize() transform. If the remaining node in the scene has a translation/rotation/scale (I don't think it should...) you may also need to either apply that to the geometry, or use it to offset the resulting navmesh. |
Beta Was this translation helpful? Give feedback.
A good starting point might be:
Untested code, but it should be something like: