X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2Fvoxel%2FMarchingCubes.java;h=88adf81e42ad1509bb8ec7898fc9ecac82a4e1c3;hp=bda9531f193539d0b91378482239b275b810299b;hb=0c970e04257c5023294666a2b1ebfa46654e1d3c;hpb=acb90f64b6986eb2e027f748bda5feadddcff390 diff --git a/src/edu/berkeley/qfat/voxel/MarchingCubes.java b/src/edu/berkeley/qfat/voxel/MarchingCubes.java index bda9531..88adf81 100644 --- a/src/edu/berkeley/qfat/voxel/MarchingCubes.java +++ b/src/edu/berkeley/qfat/voxel/MarchingCubes.java @@ -35,7 +35,7 @@ public class MarchingCubes { }; /** march iterates over the entire dataset, calling vMarchCube on each cube */ - public static void march(SampledField sampledField, double targetValue, int iDataSetSize, double fStepSize, Mesh mesh) { + public static void march(SampledField sampledField, double threshold, int iDataSetSize, double fStepSize, Mesh mesh) { int iX, iY, iZ; int initialTriangles = mesh.numTriangles(); for(iX = 0; iX < iDataSetSize; iX++) { @@ -46,7 +46,7 @@ public class MarchingCubes { (mesh.numTriangles()-initialTriangles) + " triangles"); for(iY = 0; iY < iDataSetSize; iY++) for(iZ = 0; iZ < iDataSetSize; iZ++) - march(sampledField, mesh, targetValue, iX*fStepSize, iY*fStepSize, iZ*fStepSize, fStepSize); + march(sampledField, mesh, threshold, iX*fStepSize, iY*fStepSize, iZ*fStepSize, fStepSize); } System.out.print("\r"); for(int i=0; i<78; i++) System.out.print(' '); @@ -55,7 +55,7 @@ public class MarchingCubes { } /** performs the Marching Cubes algorithm on a single cube */ - static void march(SampledField sampledField, Mesh mesh, double targetValue, double fX, double fY, double fZ, double fScale) { + static void march(SampledField sampledField, Mesh mesh, double threshold, double fX, double fY, double fZ, double fScale) { int iCorner, iVertex, iVertexTest, iEdge, iTriangle, iFlagIndex, iEdgeFlags; double fOffset; GLvector sColor; @@ -75,7 +75,7 @@ public class MarchingCubes { // Find which vertices are inside of the surface and which are outside iFlagIndex = 0; for(iVertexTest = 0; iVertexTest < 8; iVertexTest++) { - if (afCubeValue[iVertexTest] <= targetValue) { + if (afCubeValue[iVertexTest] >= threshold) { iFlagIndex |= 1<