When I first got the extracted mesh working in DBPro, it all appeared fine except the sides at -Z and -X were not capped (you could see inside the mesh). At first I assumed I was doing something wrong. I used this code:
Code:
volume[index].meshData.surfaceExtractor=new MarchingCubesSurfaceExtractor<LargeVolume<uint8_t>>(volume[index].volume,volume[index].volume->getEnclosingRegion(),volume[index].meshData.mesh);
volume[index].meshData.surfaceExtractor->execute();
But then I discovered that if I did this:
Code:
Vector3DInt32 lowerCorner=volume[index].volume->getEnclosingRegion().getLowerCorner();
Vector3DInt32 upperCorner=volume[index].volume->getEnclosingRegion().getUpperCorner();
lowerCorner.setX(lowerCorner.getX()-1);
lowerCorner.setY(lowerCorner.getY()-1);
lowerCorner.setZ(lowerCorner.getZ()-1);
volume[index].meshData.surfaceExtractor=new MarchingCubesSurfaceExtractor<LargeVolume<uint8_t>>(volume[index].volume,Region(lowerCorner,upperCorner),volume[index].meshData.mesh);
volume[index].meshData.surfaceExtractor->execute();
It worked perfectly, all sides enclosed properly. Obviously getEnclosingRegion() is failing to get the entire region. This should be corrected, but it's easy to work around for the time being.
I can be sure that it's not still my fault simply being disguised by the changed code, because the number of extracted vertices and indices goes up with the new code.
Clonkex