emacaco wrote:
It seems we want values on the "surface" to be approximately at the threshold value for the marching cubes algorithm and we want it to increase/decrease fairly rapidly on the solid/empty side of the surface.
Yes, basically the the voxel values specify the density at positions which lie on the voxel grid, and for all other positions (i.e. between the voxels) the density is calculated by linear interpolation. Vertices are then generated such that they have a position where the (interpolated) density value is equal to the threshold. The resulting mesh should separate position with a density below the threshold from positions with a density above the threshold.
I'm sorry, it's not that easy to explain! But it's the same as any other Marching Cubes implementation.
emacaco wrote:
My question then is how do I find good density values as a general case?
I have to admit I don't have much experience here, though I'm going to have to do some research for Cubiquity. If you use 3D Perlin noise then you automatically get a volume which varies smoothly from high to low values. If you generate your data another way then it might be easiest to make a 'binary' volume and then blur it (i.e. with the low pass filter).
If you want to make realtime editing tools which modify the volume while maintaining the property that it should be smooth then I think it get's more tricky. Ker's links above are a good starting point. In the sphere brush you can see that Shanee modifys the volume data by an amount which varies depending on how close it is to the centre of the bruch - i.e. it has some fall-off.
It might be worth experimenting in 2D first with a greyscale image and some oth the 'soft' brushes in PhotoShop, to get an idea of the expected behaviour.