See the Example.java file in the tutorial by Bailey and Deering.

        Vineet Gupta



At 12:53 PM 12/22/98 -0500, The Casteels wrote:
>Can someone please point me to a simple example of how to set up mouse
>navigation in a virtual world? I've tried everything I can think of and
>am still missing something.
>
>My program [snips below]  compiles and runs, but the mouse doesn't do
>anything.
>
>(I'll be cutting the program down to it's simplest form to work this out
>and will post it in its entirety if needed)
>
>
>//---------In the root program--------------------------------------
>public class NewWorld001 extends Applet implements ActionListener
> {
> TransformGroup moveView = new TransformGroup();
>
>//---------Here's what's in the objectGraph BranchGroup:----------
>
>  // Create the bounding leaf node
>  BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),
>100.0);
>  BoundingLeaf boundingLeaf = new BoundingLeaf(bounds);
>  objScale.addChild(boundingLeaf);
>
>  // Create the drag behavior node
>  MouseRotate behavior = new MouseRotate();
>  behavior.setTransformGroup(moveView);
>  moveView.addChild(behavior);
>  behavior.setSchedulingBounds(bounds);
>
>  // Create the zoom behavior node
>  MouseZoom behavior2 = new MouseZoom();
>  behavior2.setTransformGroup(moveView);
>  moveView.addChild(behavior2);
>  behavior2.setSchedulingBounds(bounds);
>
>  // Create the translate behavior node
>  MouseTranslate behavior3 = new MouseTranslate();
>  behavior3.setTransformGroup(moveView);
>  moveView.addChild(behavior3);
>  behavior3.setSchedulingBounds(bounds);
>
>//----------Under Public void
>init()--------------------------------------
>
>  u.getViewingPlatform().setNominalViewingTransform();
>  u.addBranchGraph(scene);
>
>  TransformGroup t = u.getViewingPlatform().getViewPlatformTransform();
>
>  Transform3D trans = new Transform3D();
>  t.getTransform(trans);
>
>  Transform3D holder2 = new Transform3D();
>  moveView.getTransform(holder2);
>
>  t.setTransform(holder2);
>
>
>=====================================================================
>To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
>Java 3D Home Page: http://java.sun.com/products/java-media/3D/
>
>
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to