Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

array Index

hi all:

 this is a portion of my code which i have in my cellImpl.

DisplayRenderer dr = display.getDisplayRenderer();
           MouseBehavior mb = dr.getMouseBehavior();
          double[] position1 = null;
          if (display instanceof DisplayImplJ3D) 
            {
             position1 = new double[] { 1.0,  1.0,  1.0};
            }
          int[] screen1 = mb.getScreenCoords(position1);
          System.out.println("screen1 = (" + screen1[0] + ", " + screen1[1]
+" " +screen1[2]+")");
        }
      }
    };
    cellfield2d.addReference(ref);

when i click the right mouse,  i get the error below

java.lang.ArrayIndexOutOfBoundsException
        at Spikesxxx$1.doAction(Spikesxxx.java:176)
        at visad.ActionImpl.run(ActionImpl.java:243)
        at visad.util.ThreadPool$ThreadMinnow.run(ThreadPool.java:95)

it seemns i am getting only 2 coordinates instead of 3. the missing one will
be the z-axis component. am i doing something wrong or missing something ?
what can possibly cause only two coordinates to be read ?

appreciate any help or workaround

thanks

Isaac


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