Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: PickManipulationRenderer, attaining x,y,z coordinates

Hi Brad,

The transparent volume displays depend on texture mapping
which eliminates the locations of individial points that
PickManipulationRendererJ3D needs, so texture mapping is
turned off by PickManipulationRendererJ3D.  However, its
results with 3-D grids are unpredictable since it is a crap
shoot which 3-D grid point is closest to the ray defined by
the mouse click.

Note you can retrieve the numbers printed in the upper left
corner for the cursor location when the center mouse is
pressed using DisplayRenderer.getCursorStringVector().  See
an example in visad/examples/Test00.java.  You'd trigger by
creating a DisplayListener and waiting for
DisplayEvent.MOUSE_PRESSED_CENTER.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


On Thu, 25 Nov 1999, Brad Buchsbaum wrote:

> Hi Bill, all:
> 
> I'm trying to retrieve the x,y,z coordinates of a point in the 3D Panel
> every time the user right clicks on the mouse.  Clearly this information is
> being computed somewhere, because it's displayed in the upper left of the
> display when both mouse keys are pressed.  But how to retrieve that info
> programmatically?  I tried using a PickManipulationRenderer - and it does
> allow me to get the index of the coordinates -- but it has the effect of
> turning my volume rendered image into a grid of points, one per member of
> the domain set.  This point grid is colored according to the displayType of
> the associated ScalarMap, except that each and every point is visible,
> regardless of alpha value.
> 
> Here's the code (it's been adapted from Test61):
> 
>     ScalarMap map1color = new ScalarMap(wr, Display.RGBA);
>     dpys[0].addMap(map1color);
> 
>     DataReferenceImpl ref_grid3d = new DataReferenceImpl("ref_grid3d");
>     ref_grid3d.setData(linear_ff);
> 
>     final PickManipulationRendererJ3D pick = new
> PickManipulationRendererJ3D();
>     ((DisplayImplJ3D)dpys[0]).addReferences(pick, ref_grid3d);
> 
>     CellImpl cellt = new CellImpl() {
>       public void doAction() throws VisADException, RemoteException {
>         System.out.println("index = " + pick.getCloseIndex());
> 
>       }
> 
>     };
> 
>     cellt.addReference(ref_grid3d);
> 
> 
> appreciate any help!
> 
> Brad Buchsbaum
> 
> 


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690