Hey guys, Thanks so much for the help, turns out I figured it out about an
hour after sending the question. I basically just started looking for
methods and found the getAWTEvent(). I didn't retract the question because I
wanted to see if I was doing it correctly, meaning in a manner that would
use up memory or processing power. Thanks again for the help. I have a new
question regarding this though. Part of the reason I wanted to get the key
events was to be able to move the viewport around a scene. I'm getting an
error from my code and I don't understand why its happening.

The Exception is:
xception in thread "main" javax.media.j3d.RestrictedAccessException: Cannot
mod
fy capability bits on a live or compiled object
       at
javax.media.j3d.SceneGraphObject.setCapability(SceneGraphObject.java:
01)
       at UniversePanel.createSceneGraph(UniversePanel.java:45)
       at UniversePanel.<init>(UniversePanel.java:27)
       at J3DViewer.<init>(J3DViewer.java:12)
       at J3DViewer.main(J3DViewer.java:51)

and the code where it occurs happens here. My question is, it is not
possible to move the view port using this method? if not, how can I go about
doing it??

private void createSceneGraph(SimpleUniverse su) {

      BranchGroup objRoot = new BranchGroup();

      vpTrans     = su.getViewingPlatform().getViewPlatformTransform();
      objRotate   = new TransformGroup();
      initial     = new Transform3D();
      eye         = new Point3d(eyePts);
      center      = new Point3d(0, 0, 0);
      up          = new Vector3d(0, 1, 0);
      zb          = new ZoomBehavior(vpTrans);
      rb          = new RotateBehavior(objRotate);

      vpTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
      objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

      objRoot.addChild(objRotate);
      objRotate.addChild(new ColorCube(0.4));

      zb.setSchedulingBounds(new BoundingSphere());
      rb.setSchedulingBounds(new BoundingSphere());

      objRoot.addChild(rb);
      objRoot.addChild(zb);

      initial.lookAt(eye, center, up);
      initial.invert();


      vpTrans.setTransform(initial);

      objRoot.compile();

      universe.addBranchGraph(objRoot);
   }

Thanks again for the other help and thanks for any help with this matter.

Eric

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