Modeling noob trying to use Octreefy

Hey! Quick question. I’m trying to use octreefy (fenrirwolf’s version) to extract collision-nodes from this detailed island.egg, exported from 3ds Max 2012 (with the exporter from the nightly build).

The node itself looks like this:

However, octreefy produces this. I made a geom-version to be able to show the results, but the wander-AI shows that this is exactly like the colpoly-version:

So it skips/misses a lot of vertices. Is the terrain too complex or did I forget to check a box somewhere?

Thanks!

    def load_terrain(self):
        """
        <Group> terrain {
          <Dart> { 1 }
          <Group> "Scene Root" {
            <Group> island {
              <VertexPool> island.verts {
        """
        terrain = NodePath('island')
        terrain_root = self.loader.loadModel('assets/little_vulcano.egg')
        terrain_root.find('**/terrain').getChildren().reparentTo(terrain)
        
        # self.terrain = terrain
        self.terrain = octreefy(
            terrain,
            node_name='island',
            type='geom',
            max_density=512,
            verbose=2
        )
        self.collision = octreefy(
            terrain,
            node_name='island',
            type='colpoly',
            max_density=512
        )
        self.collision.setCollideMask(BitMask32.bit(0))
        self.collision.reparentTo(self.terrain)
        self.terrain.reparentTo(self.render)

have a look at the bottom of
[url]Performances: CollisionSolid::get_bounds really greedy?!]
hope it can help!

That’s what I tried to do, to no avail.

node = NodePath('%s-leaf-%i-%i' % (node_name, indent, index))

I even started adding a random.getrandbits(128) to the name out of pure frustration. :wink:
Still investigating. Thanks for your reply!

Yeah, I’m hitting a cap somewhere. Less segments make it work better:

So I guess I do need two different eggs for the terrain and it’s collision.
Babysteps…

Your terrain looks like it could be generated from a heightmap.
You can use such a heightmap to create an efficient collision mesh.