Re: user-defined color tables; cross sections

Bill Hibbard wrote:
> 
> Si Stu,
> 
> > And is there a VisAD example that shows how to
> > create a cross section (2D display) for a plane
> > across a 3D display?  Are there pre-defined cross-sections
> > like the old drafting elevation-plan-section, or is the
> > cross section on an arbitrary plane?
> 
> There is no example in the distribution.  You create a
> Gridded2DSet with manifold dimension = 2 that defines a
> grid of points on your plane slice, then resample() your
> FlatField to that Gridded2DSet, then display the FlatField
> returned by resample().  I think Doug Lindholm has done it
> so you might talk to him - I know you guys work across the
> street from each other ;)
> 

Guilty as charged. I have done 2D slices of 3D data. VMET uses 
RealTupleType.SpatialEarth3DTuple as the MathType for the domain of its
3D data sets. To get a 2D slice I define a Gridded3DSet with manifold
dimension = 2 with:

  Gridded3DSet(MathType type, float[][] samples, int lengthX, int
lengthY) 

where 'type' = RealTupleType.SpatialEarth3DTuple and 'samples' defines
where I want the slice. Note, slices don't have to be "flat" (only
topologically "flat").

I create a new Field by calling 'resample' on the original Field using
this new Set.

I got a bit fancier because I wanted to be able to interactively move
that slice. I created a Real to represent a sliceValue. I added it to
the display (as a point) with a DirectManipulationRendererJ3D. I created
a CellImpl and added the sliceValue's DataReference. The Cell's
doAction() calls my reSlice method which does the resampling as above
based on the sliceValue.

Let me know if you want more details.

Doug

-- 
*----------------------------------------------------------------------*
| Doug Lindholm, Software Engineer          |  E-mail: lind@xxxxxxxx   |
| Research Applications Program             |   Phone: 303-497-8374    |
| National Center for Atmospheric Research  |                          |
| P.O. Box 3000                             |     There's no place     |
| Boulder, Colorado 80307-3000              |        like $HOME        |
*----------------------------------------------------------------------*


  • 2000 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: