Hi Ewan,
I think this is bug 4485481 (OrbitBehavior resets position after
ViewPlatform is translated). The README coming with Java 3D 1.3b1
mentions that bug 4504083 (OrbitBehavior resets X and Y direction) is
fixed, but unfortunately this is only because it's a duplicate of bug
4485481. There was a short discussion regarding that topic a while ago
on this list. Personally I would recommend to stay with
MoouseTranslate, MouseZoom and MouseRotate until this is really fixed.
Regards,
Ingo
> From: Ewan Borland <[EMAIL PROTECTED]>
>
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_000F_01C1ABFC.18087400
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: 7bit
>
> Hi,
>
> I'm using the orbit behaviour to move around and I've found it easy to get
> "lost" and so have included a home button which restores the nominal view
> transform. However when I begin interacting again the translation from the
> orbit behaviour jumps back to it's previous state.
>
> I've attached a small applet to demonstrate. If you rotate or zoom and then
> press the home button the nominal transform is restored and you can then
> rotate or zoom etc. normally. But if you translate the cube then press home
> any form of interaction causes the cube to jump back to it's previous
> translation but the rotation and zoom components are those for the nominal
> transform.
>
> Sorry, I've just read over this and it's not very clear: Try translating the
> cube until half of it is outside of the canvas then press home. Now try and
> rotate the cube and watch it jump.
>
> I'm using jdk1.4.0-beta3 and j3d1.3 beta1 on Windows 98 SE. I'm not sure if
> this is a bug or if I'm just going about it the wrong way but any comments
> wil be appreciated, thanks
>
> Ewan
>
>
> ----------------------------------------------------------------------------
>
> Ewan Borland
>
> Computing Science
> University of Glasgow
>
> e-mail : [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> ----------------------------------------------------------------------------
>
>
>
> ------=_NextPart_000_000F_01C1ABFC.18087400
> Content-Type: application/octet-stream;
> name="Test.java"
> Content-Transfer-Encoding: quoted-printable
> Content-Disposition: attachment;
> filename="Test.java"
>
> import java.applet.Applet;
> import java.awt.BorderLayout;
> import java.awt.Button;
> import java.awt.event.*;
> import java.awt.GraphicsConfiguration;
> import com.sun.j3d.utils.applet.MainFrame;
> import com.sun.j3d.utils.geometry.ColorCube;
> import com.sun.j3d.utils.behaviors.vp.OrbitBehavior;
> import com.sun.j3d.utils.universe.*;
> import javax.media.j3d.*;
> import javax.vecmath.*;
>
> public class Test extends Applet
> {
> private SimpleUniverse u =3D null;
>
> public BranchGroup createSceneGraph()
> {
> // Create the root of the branch graph
> BranchGroup objRoot =3D new BranchGroup();
>
> // Create a simple Shape3D node; add it to the scene graph.
> objRoot.addChild(new ColorCube(0.4));
>
> BoundingSphere bounds =3D new BoundingSphere(new
>Point3d(0.0,0.0,0.0), =
> 100.0);
>
> // Have Java 3D perform optimizations on this scene graph.
> objRoot.compile();
>
> return objRoot;
> }
>
>
> public Test() {}
>
>
> public void init()
> {
> setLayout(new BorderLayout());
> GraphicsConfiguration config =3D =
> SimpleUniverse.getPreferredConfiguration();
>
> Canvas3D c =3D new Canvas3D(config);
> add("Center", c);
>
> // Create a simple scene and attach it to the virtual universe
> BranchGroup scene =3D createSceneGraph();
> u =3D new SimpleUniverse(c);
>
> // This will move the ViewPlatform back a bit so the
> // objects in the scene can be viewed.
> u.getViewingPlatform().setNominalViewingTransform();
>
>
> // Set up mouse interaction
> OrbitBehavior orbit =3D new OrbitBehavior(c, =
> OrbitBehavior.REVERSE_ROTATE);
> orbit.setSchedulingBounds(new BoundingSphere(new Point3d(), =
> Double.POSITIVE_INFINITY));
> u.getViewingPlatform().setViewPlatformBehavior(orbit);
>
> // Create home button
> Button home =3D new Button("Home");
> home.addActionListener( new ActionListener()
> {
> public void actionPerformed(ActionEvent ae)
> {
> u.getViewingPlatform().setNominalViewingTransform();
> }
> });
> add("North", home);
>
> u.addBranchGraph(scene);
>
> }
>
>
> public void destroy()
> {
> u.removeAllLocales();
> }
>
>
> public static void main(String[] args)
> {
> new MainFrame(new Test(), 256, 256);
> }
>
> }
===========================================================================
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".