Hi, I have severals questions
Question 1I use this code :
Code:
#define _VD_ 300
//...
MyPolyVoxMethod()
{
//...
SimpleVolume<MaterialDensityPair44> volData(Region(Vector3DInt32(0,0,0), Vector3DInt32(_VD_, _VD_, _VD_)),1);
uint8_t uDensity = VoxelTypeTraits<MaterialDensityPair44>::MaxDensity;
int x,y,z;
int X,Y,Z;
int VecteurX, VecteurY, VecteurZ=80;
int gap = 2;
for(Z=1; Z < _VD_-VecteurZ-gap; Z+=VecteurZ+gap)
{
for (z = Z; z <= Z+VecteurZ; z++)
{
for ( y = 1; y < (int) (0.01*_VD_); y++)
{
for ( x = 1; x < (int) (0.1*_VD_); x++)
{
MaterialDensityPair44 voxel = volData.getVoxelAt(x,y,z);
voxel.setDensity(uDensity);
volData.setVoxelAt(x, y, z, voxel);
}
}
}
}
}
//...
}
If I'm using the next method to get the surface,
Code:
CubicSurfaceExtractorWithNormals<SimpleVolume, MaterialDensityPair44 > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
I get what I expected
right-angle and a space (gap) created at regular intervals.
but I can't set a gap of 1, 2 seems to be the smaller. I don't understant this, one should be the smallest...
actualy I don't want to use
Code:
CubicSurfaceExtractorWithNormals<SimpleVolume, MaterialDensityPair44 > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
but
Code:
SurfaceExtractor<SimpleVolume, MaterialDensityPair44 > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
to obtain later, some things more smoother, If I use my example, I get this
I lost the right-angle, I guess it's about the interpolation method, how can I fix that ?
Question 2:as you can see, all for() loops start from 1 not 0. If they start from 0 I get,
faces on the borders of the volume aren't considered, why ?
Question 3:all of these tests needed ~15 sec. to get the mesh. It's not possible to do that in realtime ?