RE: center of rotation for three-d views?

Hi Donna,

> >Yes, you can do anything you want with the getMatrix()
> >and setMatrix) methods of ProjectionControl. For a
> >DisplayImplJ3D, this is just the standard Java3D 4x4
> >matrix. You can create an extension of the MouseBehaviorJ3D
> >class to interpret mouse events in new ways. Your extension
> >must have the constructor signatures that takes a
> >DisplayRendererJ3D argument, then you pass the class of
> >your extension to DisplayRendererJ3D constructor that
> >takes the 'Class mbj3dClass' argument.

I should have said "... pass the class of your extension to
DefaultDisplayRendererJ3D constructor ...".

> I was wondering if I might have a few signposts here; what methods
> in the extension of MouseBehavior3D would need to be implemented? Or
> would I need to create a new version of MouseHelper?

The main method you need to extend is processStimulus(). Note that
is delegates its work to the processEvent() method of its MouseHelper,
but that's only so our J2D and J3D code can share their logic in
MouseHelper. I think your extension of MouseBehaviorJ3D could dispense
with MouseHelper. Or you could process certain events right in
processStimulus() and pass other events to MouseHelper.processEvent()
(I've never tried this, so cannot be sure it will work). Or you could
define an extension of MouseHelper and construct an instance in the
constructor of your MouseBehaviorJ3D extenson - that way your code
would look a lot like the current VisAD code. To write your event
handling logic, I'd suggest cut and paste editing of MouseHelper.

> On a different note, is it possible to have "pick-like" things happen on
> a hover, rather than on a "click"? (Such as popping up information on the
> point you are over)

Note that MouseHelper.processEvent() does catch and process
MouseEvent.MOUSE_MOVED events. All it does is notify listeners
about them, but you could use them to trigger the MouseHelper
logic normally triggered by mouse clicks and/or drags. You'd
have to work out what kinds of user mouse gestures did what.

Good luck,

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