Hmmm....

I use the OrbitBehavior in one of our utility programs.  As a test I created
a button which did this:

   void jButton1_actionPerformed(ActionEvent e) {

        Transform3D t = new Transform3D();
        t.lookAt(new Point3d(100,0,100),new Point3d(0,0,0),new
Vector3d(0,1,0));
        t.invert();
        vp.getViewPlatformTransform().setTransform(t);

   }

The setup code was like this:

        orbit = new OrbitBehavior(canvas);
        orbit.setMinRadius(20);
        orbit.setSchedulingBounds(new BoundingSphere(new
Point3d(0.0,0.0,0.0), 2000.0));
        u.getViewingPlatform().setViewPlatformBehavior(orbit);
        Transform3D t = new Transform3D();
        t.lookAt(new Point3d(100,0,100),new Point3d(0,0,0),new
Vector3d(0,1,0));
        t.invert();
        vp.getViewPlatformTransform().setTransform(t);

And it works fine.  After I press the button the view resets and rotations
and scale work fine after that.

Maybe the secret is this line:

u.getViewingPlatform().setViewPlatformBehavior(orbit);


Dave Yazel
----- Original Message -----
From: J. Lee Dixon <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 18, 2001 9:45 AM
Subject: [JAVA3D] Resetting OrbitBehavior


Just started playing with OrbitBehavior.  Is there an (easy) way to
reset the view once you have orbited/translated into nowhere?  I tried
doing a ViewPlatform.setNominalViewTransform(), which brings things back
into view, but OrbitBehavior remembers his last
translation/rotation/zoom settings and restores them as soon as you
start rotating again.

-Lee

J. Lee Dixon, Sr Software Engineer
SAIC - Celebration, FL
321-939-7917
[EMAIL PROTECTED]    AOL: LeeOrlando

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

Reply via email to