John asked a similar question, I copied his message and the answer below.

Only Daniel Selman sent an answer. I want to ask a question, could anyone
tell me, is it a bug for PickTranslateBehavior?Am I write a new
"PickTranslateBehavior" class like Selman did?
nagehan

////////////////////////////////////////////////////////////////////////////////////////////

John,

I discuss this very problem in my book, and have coded some replacements for
the SUN mouse behaviors.

You can grab the source from the Manning website. They are called
TornadoMouseRotate, TornadoMouseTranslate etc. The example to run is called
MouseNavigateTest:

/**
* This example illustrates the mouse behaviors defined in the
* org.selman.java3d.book package. These improved mouse
* behaviors:
*  - handle TransformGroups above the target TG properly <br>
*  - can be applied to any object, not just TGs <br>
*  - support interface reporting to give easy feedback on all manipulations
<br>
*  - better motion speed control <br>
*  - range validation to clamp scales and translation between limits <br>
*/
public class MouseNavigateTest extends Java3dApplet
       implements ScaleChangeListener, RotationChangeListener,
TranslationChangeListener

...

Sincerely,

Daniel Selman

Author - "Java 3D Programming"
http://www.manning.com/selman

-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED] Behalf Of John O'Hara
Sent: Tuesday, March 19, 2002 5:06 PM
To: [EMAIL PROTECTED]
Subject: PickTranslationBehavior and Building 3D Surfaces


Hello all,


I was hoping someone good give me some direction in dealing with the
PickTranslateBehavior in Java3D.

I have a 3D scene graph with a 16 spheres (representing control points on a
surface).  To this I have attached a pickTranslateBehavior on the root, so
I can move any of the spheres.

However, in the scene graph, I also have a MouseRotate and MouseZoom
behavior attached to the root graph to allow the user to view the surface
from any angle.

My problem is as follows:

If I rotate around the scene so I am looking at the scene from somewhere
other than the XY plane, the PickTranslateBehavior does not adjust
itself.     For example.  In its initial state, I can grab a sphere and
move it up, down, left, right, and it will follow the mouse, as
expected.   However, if I rotate the scene 180 degrees and flip, the
translation does not adjust.  In this case, picking a sphere and dragging
the mouse right will move the sphere left.  Dragging up moves the sphere
down, etc.

Is there a way I can configure the PickTranslateBehavior to always move the
selected object in a plane which is parallel to the view?

Thanks for your help,

John O'Hara

_________________________________________________________________
Add MSN 8 Internet Software to your existing Internet access and enjoy
patented spam protection and more.  Sign up now!
http://join.msn.com/?page=dept/byoa

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to