IsoSurface Rendering of an AR Representation

rlaramee
Class Interpolator

java.lang.Object
  |
  +--rlaramee.Interpolator

public class Interpolator
extends java.lang.Object

Description: The interpolator handles all of the interpolation calculations. When a contour value falls between two vertex values in a cube, a linear interpolation is computed to find out where between the two vertices the intersection occurs. Having a separate interpolator class allows for flexibility of implementaion. We may decide at some point that we may want to implement different kinds of interpolation other than linear.

start date Sun 02 May 1999

Version:
1.0
Author:
Robert S Laramee
See Also:

Constructor Summary
Interpolator()
          constructor
 
Method Summary
private  float interpolate(double coord1, double coord2, double data1, double data2, double isoValue)
          The formula we'll use to interpolate:
 float interpolate(float scalar1, float scalar2)
          This interpolating function is called from Cube.subDivide() It is simpler than the interpolate function for 2 cube vertices.
 TriangleVertex interpolate(int axis, CubeVertex cv1, CubeVertex cv2, double isoValue, byte edge)
          This is a linear interpolation function for two cube vertices with x,y,z coordinates.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

Interpolator

public Interpolator()
constructor
Method Detail

interpolate

public TriangleVertex interpolate(int axis,
                                  CubeVertex cv1,
                                  CubeVertex cv2,
                                  double isoValue,
                                  byte edge)
This is a linear interpolation function for two cube vertices with x,y,z coordinates.
It's called from the IsoSurface object

Parameters:
axis - the axis along which to interpolate
v1 - 1st cube vertex
v2 - 2nd cube vertex
isoValue - the isoValue between the vertices
edge - the cube edge that the new vertex lies on (0 - 11)
Returns:
TriangleVertex -a new triangle vertex that is the linear interpolation of the two cube vertices

interpolate

private float interpolate(double coord1,
                          double coord2,
                          double data1,
                          double data2,
                          double isoValue)
The formula we'll use to interpolate:
 start coordinate + (interpolated value * scale factor)
 
Parameters:
data1 - the 1st vertex's data value
data2 - the 2nd vertex's data value
coord1 - the 1st coordinate value to interpolate between
coord2 - the 2nd coordinate value to interpolate between
isovalue - the isosurface value
Returns:
the interpolated value

interpolate

public float interpolate(float scalar1,
                         float scalar2)
This interpolating function is called from Cube.subDivide() It is simpler than the interpolate function for 2 cube vertices. All it does is a linear interpolation between 2 scalar values. It turns out just to be an average of the 2 scalar values because it is a linear interpolation exactly half way between the vertices in x,y,z coordinate space.

This is because we are not looking for an isosurface. We are just subdividing a cube into 8 child cubes.

Parameters:
scalar1 - the 1st scalar value
scalar2 - the 2nd scalar value
Returns:
-the linear interpolation of the 2 scalar values

IsoSurface Rendering of an AR Representation