Smooth LOD example now uses free function surface extractor.

This commit is contained in:
David Williams 2014-05-11 16:29:51 +02:00
parent 347028199c
commit 95a3e2e9ce

View File

@ -90,15 +90,11 @@ int main(int argc, char *argv[])
volumeResampler.execute(); volumeResampler.execute();
//Extract the surface //Extract the surface
SurfaceMesh<PositionMaterialNormal> meshLowLOD; auto meshLowLOD = extractMarchingCubesSurface(&volDataLowLOD, volDataLowLOD.getEnclosingRegion());
MarchingCubesSurfaceExtractor< RawVolume<uint8_t> > surfaceExtractor(&volDataLowLOD, volDataLowLOD.getEnclosingRegion(), &meshLowLOD);
surfaceExtractor.execute();
meshLowLOD.scaleVertices(/*2.0f*/63.0f / 31.0f); meshLowLOD.scaleVertices(/*2.0f*/63.0f / 31.0f);
//Extract the surface //Extract the surface
SurfaceMesh<PositionMaterialNormal> meshHighLOD; auto meshHighLOD = extractMarchingCubesSurface(&volData, PolyVox::Region(Vector3DInt32(30, 0, 0), Vector3DInt32(63, 63, 63)));
MarchingCubesSurfaceExtractor< SimpleVolume<uint8_t> > surfaceExtractorHigh(&volData, PolyVox::Region(Vector3DInt32(30,0,0), Vector3DInt32(63, 63, 63)), &meshHighLOD);
surfaceExtractorHigh.execute();
meshHighLOD.translateVertices(Vector3DFloat(30, 0, 0)); meshHighLOD.translateVertices(Vector3DFloat(30, 0, 0));
//Pass the surface to the OpenGL window //Pass the surface to the OpenGL window