Original Post
Hi, i have a problem with my octree again...
There are some "holes" in my polygon soup after it is partitioned by the octree, so some polys are just not added to any node since the poly - in AABB test fails.
Just to note, i split everything that spans the three cardinal planes.
But why does it not work?
Here are the calculated centers for my eight child nodes based on the center of the current node.
// lower left, front node->_octants[0] = new ZNode(minX, minY, mid._z, mid._x, mid._y, maxZ); // lower right, front node->_octants[1] = new ZNode(mid._x, minY, mid._z, maxX, mid._y, maxZ); // lower left, back node->_octants[2] = new ZNode(minX, minY, minZ, mid._x, mid._y, mid._z); // lower right, back node->_octants[3] = new ZNode(mid._x, minY, minZ, maxX, mid._y, mid._z); // upper reft, front node->_octants[4] = new ZNode(minX, mid._y, mid._z, mid._x, maxY, maxZ); // upper right, front node->_octants[5] = new ZNode(mid._x, mid._y, mid._z, maxX, maxY, maxZ); // upper left, back node->_octants[6] = new ZNode(minX, mid._y, minZ, mid._x, maxY, mid._z); // upper right, back node->_octants[7] = new ZNode(mid._x, mid._y, minZ, maxX, maxY, mid._z);And I use this test to test a poly against a child node´s AABB Pseudo code: set nodeMin = min of child node´s AABB set nodeMax = max of child node´s AABB for (each poly in parent node) { set nInside to 0 for (each vertex in poly) { if ((v.x >= nodeMin.x) && (v.x <= nodeMax.x) && (v.y >= nodeMin.y) && (v.y <= nodeMax.y) && (v.z >= nodeMin.z) && (v.z <= nodeMax.z)) nInside++; } end vertex loop if nInside == number of verts in poly then add poly to this child node } could you see what is wrong? i didn´t find the error, since my AABB´s seem to get calculated right. thanks in advance Gammastrahler [edited by - Gammastrahler on April 22, 2004 6:15:28 AM]