|
Hi Eric,
I am currently using a variation of your behaviour. Unfortunately, a bug in
the Transform3D code in the newest release of J3D is causing some problems.
Kelvin assured me that this bug will be fixed in the next service patch, but in
the meantime I thought I'd try the new orbit behaviour. Have you noticed
BadTransform exceptions using your orbit behaviour?
josh >>> [EMAIL PROTECTED] 04/05/01 09:36AM
>>> Josh, you might want to look at my orbit behavior. It
does not snap the view so that the new center is in the middle of the
view. Of you want to orbit an object that is centered in the view, you
must translate the view so that the object is centered and then you can orbit
the object as if it was centered. http://www.sigda.org/Eric/java3d/behaviors/index.htmAt 09:19
AM 04/05/2001 -0400, you wrote:
Hi Andrea,
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.
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".
***********************************************************************
Eric N. Reiss
MEMS Manager
Swanson Center for Product Innovation
Department of Mechanical Engineering
School of Engineering - University of Pittsburgh
3700 O'Hara Street
647 Benedum Hall
Pittsburgh, Pennsylvania 15261
Phone: 412-624-9696
FAX: 412-624-7701
Email: [EMAIL PROTECTED]
***********************************************************************
|