> Thanks for the reply. What I would like to see is that when I select
> a new center of rotation, and then use the mouse to rotate,
> the view does not immediately re-center on (i.e., translate to) the
> new center of rotation.

> For example, consider points A and B shown in the view where A is the
> current rotational center, and B is somewhere in the top-left corner
> of the view. If I select B as the new center of rotation, I do not
> want the view translated so that B is in the center of the view.
> Instead, I would like the view to orbit around B and have B remain at
> its position in the top-left corner of the view. Does that make more
> sense?

> In order to achieve this, xtrans and ytrans must be updated whenever a
> new center of rotation is selected. If I understand the
> code correctly, xtrans and ytrans are the translational vector from
> the center of the screen to the center of rotation projected
> onto the image plate. Unfortunately, I can't figure out how to recover
> xtrans and ytrans given only the new center of rotation.

We are investigating this as a potential bug in OrbitBehavior.  It seems
strange to me also that the view would jump when you set the center of
rotation.  For now, you can create your own OrbitBehavior by modifying
ours to update the xtrans and ytrans variables when the rotation center
is set.  Just add two lines of code to the beginning of the
setRotationCenter() method:

        xtrans += (rotationCenter.x-center.x);
        ytrans += (rotationCenter.y-center.y);

Is this what you are trying to accomplish?

andrea



 josh

 >>> [EMAIL PROTECTED] 04/04/01 05:51PM >>>
 > Hi,
 >
 > I've been toying with Sun's new OrbitBehavior and have a question
 > regarding how it tracks translation of the view. Currently this is
 > stored by "xtrans" and "ytrans" which are updated as the mouse is
 > dragged. If the user changes the center of rotation, however, xtrans
 > and ytrans are not updated and the view will automatically snap to
 be
 > centered on the center of rotation. While this is sometimes desired,
 > it if often not.

 > Is there an easy way to recover xtrans and ytrans from the view
 > transform that will not be susceptable to the BadTransform3D bug?

 I'm not sure I understand what you are asking for.  But I can describe
 to you what is happening.  When you set the rotation center, none of
 the
 transforms are updated until the mouse moves again.  The view's
 translation is being stored in the xtrans and ytrans variables.  When
 the transforms are integrated, the translation is calculated based on
 the current rotation center.  What behavior are you looking for?

 andrea

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