Hi Ewan,
I had encountered similar problems while resetting the transform,
though by using my own code and not by using the setHomeTransform method.
My guess is that your home transform positions the viewplatform
at some other location other than the z-axis.
I had informed Kelvin Chung of exactly the same fix: removing the
centerToView.* coding in integrateTransforms; I should hasten to
add that I am not sure if this is what is the cause for your
particular problem also.
Kelvin had since sent me a modified version of OrbitBehavior.java,
and it appears to work well with my own overrides etc. for my
class of problems. I am not sure if it is legal for me to e-mail
you the official code :). Perhaps, Kelvin may get to see (y)our
e-mail(s) and publish the code himself. I think he is waiting for
beta2 release.
If the modified version fixes your problems straight off,
you may save time in not putting together a testcase. So, perhaps
you should wait.
HTH,
Raj Vaidya
>On Sat, 16 Mar 2002 23:30:48 -0000, Ewan Borland <[EMAIL PROTECTED]> wrote:
>I've been using the setHomeTransform() and goHome() methods of
>ViewPlatformBehavior on anOrbitBehavior and getting some strange results.
>
>I should say that I reported an OrbitBehavior bug a couple of months back
>and was given a fix by the J3D team so I'm using a version of OrbitBehavior
>without those bugs (sorry don't have the ID numbers to hand but the message
>will be in the archives).
>
>I'm allowing the user to set the home transform by clicking a button with
>the following actionPerformed method:
>
>public void actionPerformed(ActionEvent ae)
> {
> // Retrieve the current view transform
>
>orbit.getViewingPlatform().getViewPlatformTransform().getTransform(homeTrans
>form);
>
> // Set it as the home transform for the OrbitBehavior
> orbit.setHomeTransform(homeTransform);
>
> } // actionPerformed
>
>Then when the user presses a "Home" button I simply call orbit.goHome() and
>the view transform is indeed set as equired. However depending on the home
>transform I get strange results when the user begins interacting again:
>
>1. If the user has only zoomed before setting the home transform then
>everything works fine.
>
>2. If the user has performed x,y translations before setting the home
>transform then there is a small but perceptible jump in the +ve z direction
>when they interact after having "gone home".
>
>3. If the user has performed any rotations before setting the home
>transform, there is a large jump in either the x, y or both directions
>(normally big enough that any object at the rotation centre goes out of
>view) when they interact after having "gone home".
>
>When I first noticed this I took a quick look at the orbit behavior code. By
>changing
>
> transVector.x = rotationCenter.x + xtrans + centerToView.x;
> transVector.y = rotationCenter.y + ytrans + centerToView.y;
>
>to
>
> transVector.x = rotationCenter.x + xtrans;
> transVector.y = rotationCenter.y + ytrans;
>
>I obviously lost any translation associated with the home transform but all
>other problems vanished .... so maybe there's a problem with the resetting
>of the centerToView translation?
>
>My code's in a big app but I'll try and get a small test as soon as I can if
>necessary.
>Cheers for any help, sorry if someone's already documented this.
>
>Ewan
>
> ==========================================================================
>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".
===========================================================================
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".