public class MarchingCubes
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int[] |
cubeEdgeFlags
For any edge, if one vertex is inside of the surface and the other is
outside of the surface then the edge intersects the surface.
|
private static int[][] |
edgeConnection
edgeConnection lists the index of the endpoint vertices for each of
the 12 edges of the cube.
|
private static float[][] |
edgeDirection
edgeDirection lists the direction vector (vertex1-vertex0) for each
edge in the cube.
|
private static int[][] |
triangleConnection
For each of the possible vertex states listed in cubeEdgeFlags there
is a specific triangulation of the edge intersection points.
|
private static float[][] |
vertexOffset
vertexOffset lists the positions, relative to vertex0, of each of
the 8 vertices of a cube.
|
Constructor and Description |
---|
MarchingCubes() |
Modifier and Type | Method and Description |
---|---|
private static float |
fGetOffset(float fValue1,
float fValue2,
float fValueDesired)
fGetOffset finds the approximate point of intersection of the surface
between two points with the values fValue1 and fValue2.
|
(package private) Point3DFloat |
getColor(Point3DFloat rfPosition,
Point3DFloat rfNormal)
getColor generates a color from a given position and normal of a
point.
|
static java.util.Vector<Triangle3DFloat> |
triangulateHull(float xMin,
float xMax,
int xSteps,
float yMin,
float yMax,
int ySteps,
float zMin,
float zMax,
int zSteps,
Field3DFloat field,
float targetValue)
triangulateHull iterates over a Field3DFloat and returns a vector
of triangles that represent its external hull, with the external hull
being defined as the points that are greater than or equal to
targetValue.
|
private static final float[][] vertexOffset
private static final int[][] edgeConnection
private static final float[][] edgeDirection
private static final int[] cubeEdgeFlags
private static final int[][] triangleConnection
private static float fGetOffset(float fValue1, float fValue2, float fValueDesired)
Point3DFloat getColor(Point3DFloat rfPosition, Point3DFloat rfNormal)
public static java.util.Vector<Triangle3DFloat> triangulateHull(float xMin, float xMax, int xSteps, float yMin, float yMax, int ySteps, float zMin, float zMax, int zSteps, Field3DFloat field, float targetValue)