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".

Reply via email to