Re: polyhedral cells

Hi Randy,
 
Actually, your hexahedron is being displayed, as its eight
vertices, but they fall at the eight vertics of the reference
box and are obscured.  There are two things you can do to
make them visible (do one or both).  First, make the vertices
large by adding the following two lines somewhere after you
construct display:
 
    GraphicsModeControl mode = display.getGraphicsModeControl();
    mode.setPointSize(5.0f);
 
Second, move the points away from the vertices of the reference
box by changing these three lines:
 
    display.addMap(new ScalarMap(x, Display.XAxis));
    display.addMap(new ScalarMap(y, Display.YAxis));
    display.addMap(new ScalarMap(z, Display.ZAxis));
 
to:
 
    ScalarMap xm = new ScalarMap(x, Display.XAxis);
    ScalarMap ym = new ScalarMap(y, Display.YAxis);
    ScalarMap zm = new ScalarMap(z, Display.ZAxis);
    xm.setRange(-1.0, 1.0);
    ym.setRange(-1.0, 1.0);
    zm.setRange(-1.0, 1.0);
    display.addMap(xm);
    display.addMap(ym);
    display.addMap(zm);
 
This sets the reference box bounds to (-1.0, +1.0) in the
x, y and z dimensions.
 
Of course, there is also the question of why VisAD depicts your
hexahedron by its vertices.  Given a Set whose RealType components
are all mapped to spatial DisplayRealTypes (i.e., XAxis, YAxis,
ZAxis), it can be depicted by geometries whose manifold dimension
is less than or equal to the manifold dimension of the Set.  The
default VisAD DataRenderers only offer two choices: depiction as
vertices (0-D) or depiction in the manifold dimension of the Set
(edges for a set with manifold dimension 1 and faces for a Set
with manifold dimension 2).  Unfortunately, volumes are not yet
implemented for Sets with manifold dimension 3, so the only
current choice is vertices.  For Sets with manifold dimension
1 or 2, the default DataRenderers will generate depictions as
edges or faces unless the application invokes:
 
    GraphicsModeControl mode = display.getGraphicsModeControl();
    mode.setPointMode(true);
 
Sets do not commonly occur as Data objects in their own right, but
rather occur as the domains of Fields.  In this case, dependent
variables of the Field can be mapped to IsoContour to generate
iso-surfaces.  There are examples of interactive iso-surfaces like
this in examples/DisplayTest.java case 1 (Gridded3DSet) and case 2
(Irregular3DSet).
 
Applications can also map the RealType components of Sets to
IsoContour, as in examples/HSVDisplay.java.  To do that in
hex.java you would add the following code:
 
    ScalarMap cm = new ScalarMap(z, Display.IsoContour);
    display.addMap(cm);
    ContourControl cc = (ContourControl) cm.getControl();
    cc.enableContours(true);
    cc.setSurfaceValue(0.0f);
 
before:
 
    display.addReference(ref); // link ref to display
 
One of these days we will implement volume rendering.  It would
also be possible to implement a custom DataRenderer that depicts
3-D sets by their edges or faces - let me know if you want to
pursue that option and I will give you some guidance.
 
Cheers,
Bill
 
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
whibbard@xxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html