DJDD wrote:
To extend that, you'd also have to think about the difference between a cliff and a mound. A cliff would be say a wall >= 2 voxels high, whereas a voxel sitting alone above an otherwise flat area would be a mound. How would you represent this? Can you represent this at all? Maybe this sort of logic must come as part of customization conditionals written as part of the extraction.
actually you won't differentiate at all. everything in marching cubes works on a voxel and it's direct surroundings.
in SurfaceExtractor.inl:429-507 you see the part that creates the vertices.
Basically it should be enough to check whether one of the voxels has "cubic-density" and if it does do a custom vertex positioning.
as long as you create a vertex wherever marching cubes would create a vertex, it should nicely match up with the index creation part.
It might just work and not be a riddiculous amount of work
EDIT:
if i see it correctly, the line
Code:
float fInterp = static_cast<float>(VoxelType::getThreshold() - v000.getDensity()) / static_cast<float>(v100.getDensity() - v000.getDensity());
and it's y/z counterparts are what would do the magic...
if the density of the v100 is max density, all you do is set fInterp to
Code:
fInterp = static_cast<float>(VoxelType::getThreshold() - v000.getDensity()) / static_cast<float>(VoxelType::getMinDensity()- v000.getDensity());
else compute like usual.
it would not be perfect, but close enough as a start.