Egg Octree

[UPDATE] :

  1. I don’t use this original part anymore :
      # Loop on the vertices determine the bounding box
      minBB = Point3D()
      maxBB = Point3D()

      nverts = vpool.getHighestIndex()
      for iv in range(nverts + 1) :
         vtx = vpool[iv]
         vtxPos = vtx.getPos3()

         # Sets the X, Y or Z components
         i = 0
         for set in [Point3D.setX, Point3D.setY, Point3D.setZ]  :
            if vtxPos[i] < minBB[i] :
               set(minBB, vtxPos[i])

            if vtxPos[i] > maxBB[i] :
               set(maxBB, vtxPos[i])
            i += 1

      minBB -= Vec3D(0.001, 0.001, 0.001)
      maxBB += Vec3D(0.001, 0.001, 0.001)

There was a little noticable offset in the result, along Z. Now I use tight bounds, which gives acurate result :

      # model's bounding box
      minB,maxB=sourceNode.getTightBounds()
      minBB = Vec3D(minB[0]+0.001, minB[1]+0.001, minB[2]+0.001)
      maxBB = Vec3D(maxB[0]+0.001, maxB[1]+0.001, maxB[2]+0.001)
  1. improved vertices addition to the pool, now vertices are unique to avoid duplicated vertices.
  2. added scenegraph hierarchy walk, just like in pview, using arrow keys, in addition to the GUI.
  3. fixed 1 tiny bug in the SceneGraphBrowser GUI.
    discourse.panda3d.org/viewtopic.php?t=3474

The result of this octree is a single huge vertex pool and the octree groups of geoms. I’m still clueless about the failure involving poly counts. It failed on my 97792 vertices, 97410 tris model, but not on my 307583 vertices, 203090 tris model. It’s silent death, no spit on the console at all. I checked for maximum poly count for each octree’d geom, it isn’t excessive at all. Each geom’s poly counts is limited by the cell size, so using a small cell size should not fail, but it failed. So, it’s definitely something else beyond my reach :S
If someone could help, please [size=200]H E L P[/size] !!
Thank you.