Re: zoom in Zoom out

Hi Yakup,

> In order to zoom in or out, I press on Shift key and drag mouse up or down. I 
> would like to give user an option thus he will be able to zoom in or zoom 
> out. Which method or class is used to zoom in or zoom out. By the way, How 
> can I find the shortcut keys used in Visad?
> Thanks for Visad, it really makes everything easier.

You can control zoom via:

  ProjectionControlJ3D pc
    (ProjectionControlJ3) display.getProjectionControl()

then use ps.getMatrix() to get the 4x4 matrix, modify it
to change the zoom (see the Java3D documentation for details)
and use pc.setMatrix() to set the new 4x4 matrix.

For shortcut keys, call

  DisplayRendererJ3D dr
    (DisplayRendererJ3D) display.getDisplayRenderer();
  KeyboardBehaviorJ3D kb = new KeyboardBehaviorJ3D(dr);
  dr.addKeyboardBehavior(kb);

See the JaavaDoc for KeyboardBehaviorJ3D for default key
assignments.

Cheers,
Bill


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