Hi all,

I'm trying to realize visual Dragging of Objects. I use a
ViewPlatformAWTBehavior for Navigation and try to use it for Dragging,
too. The Problem is, that the Objects I try to move, do not move with
the Cursor but faster, depending on "how far" the Object is in the
virtual space. So when I drag the Mouse-Cursor 10 Pixels to the left,
the selected Object just moves about 30.

The code I use is this (oldPos is the Event-Point of the previous
Dragged Event):

Point newPos = event.getPoint();
Vector3f drag = new Vector3f();
drag.x = (newPos.x - oldPos.x);
drag.y = (newPos.y - oldPos.y);
// this transform is the Transform3D of the ViewPlatform-TransfornGroup
transform.transform(drag);
// move just adds the three floats to the current
// TransformGroup-Translation of the selected Object
object.move(drag.x,drag.y,drag.z);

My guess is that I need to calculate the distance from the View to the
selected Object, but currently I have no idea, how. I also took a look
at the source-code of the MouseTranslateBehavior, but somehow this does
not work either.

So, does anybody have an idea?
Thanks in advance

Jin-Ha Tchoe

===========================================================================
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