drwbns wrote:
But something strange I notice is that the size of the terrain is still about the same, but the faces are missing on the outside of the mesh and ok on the top of the mesh.
Yes, this is what I would have expected. Triangles are only generated when the extractor finds solid voxels next to empty ones. In your case you have solid voxels inside the volume and empty voxels outside - that is, the change beteen solid and empty occurs at the edge of the volume. But because my suggested change stopped it processing these edge cases you no longer see those triangles.
However, having looked at the code I now realise what is
really going on. Basically, the assert you are hitting is making sure that there are no more than 1000000 vertices in the generated mesh. This is a hardcoded value which should not be there, and I will change this assert for the next release of PolyVox.
In the mean time, I believe you can sefely just comment out the relevant asserts in SurfaceExtractor.inl
Code:
assert(ind0 < 1000000);
assert(ind1 < 1000000);
assert(ind2 < 1000000);
drwbns wrote:
I still have the problem also where I'm only getting 2 dimensions correct, the 3rd dimension is just repeated across the plane.
I think the problem is the way you are reading your heightmap:
Code:
int height = myTerrainHM.getColourAt(x,y,0);
In my original code I use x and z rather than x and y. Try:
Code:
int height = myTerrainHM.getColourAt(x,z,0);