I think what a lot of us do is build our own setup so we can access things
like transform.  Here is a snippet from my code, which won't compile out of
context, but should help you.  Note that modifying vpTrans will modify the
view.

      locale = new Locale(this);
      // Create a ViewPlatform, TransformGroupNode, Transform3D for position
      vp = new ViewPlatform();
      // Set up the properties of the ViewPlatform
      // Will be relevant when becomes part of live scene graph
      vp.setCapability(ViewPlatform.ALLOW_POLICY_READ);
      vp.setCapability(ViewPlatform.ALLOW_POLICY_WRITE);
      vp.setCapability(ViewPlatform.ALLOW_LOCAL_TO_VWORLD_READ);
      vp.setCapability(ViewPlatform.ENABLE_COLLISION_REPORTING);
      Transform3D t = new Transform3D(); // at the origin of the locale
      vpTrans = new TransformGroup(t);
      // Set capabilities to allow for changes when live.
      vpTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
      vpTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
      vpTrans.setCapability(TransformGroup.ALLOW_CHILDREN_READ);
      vpTrans.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);
      vpTrans.addChild(vp);

      // Create a View object to attach to the ViewPlatform
      // Use default values for all the complicated head movement stuff
      view = new View();
      view.addCanvas3D(c);
      PhysicalBody body = new PhysicalBody();
      view.setPhysicalBody(body);
      PhysicalEnvironment env = new PhysicalEnvironment();
      view.setPhysicalEnvironment(env);
      view.attachViewPlatform(vp);
      view.setFieldOfView(view.getFieldOfView()*1.5);
      view.setWindowResizePolicy(view.PHYSICAL_WORLD);

      // Use the default PhysicalEnbironment to create Sound Device
      file://javaSoundMixer = new JavaSoundMixer(env);
      file://javaSoundMixer.initialize();

      // Create a BranchGroup to allow attachment of all this stuff to
      // the Locale object
      vpRoot = new BranchGroup();
      vpRoot.setCapability(Group.ALLOW_CHILDREN_EXTEND);
      vpRoot.addChild(vpTrans);
      locale.addBranchGraph(vpRoot);


----- Original Message -----
From: Jonathan Albert C Vallar <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 28, 2001 6:05 AM
Subject: [JAVA3D] Help!


I've been trying to mail the interest group but this mail does not reach the
group because no mail went back to my account.Anyway, I hope this reaches
the mailing list. :)

Can I ask if there is a possibility that I can get the parent of the
viewplatform and modify the rotation component of the set transform3d.I want
to simulate a set of buttons that
show a rotation along the x and y axes by modifying the transformgroup above
the viewplatform.


My code is:

                  m2=new Matrix3d();
                        tempviewplat=active_site.getViewPlatform();
                        tempTG=(TransformGroup)tempviewplat.getParent();
                        tempTG.getTransform(tempT3D);
                        tempT3D.getRotationScale(m1);
                        m2.rotX(rot_degree);
                        m1.mul(m2);
                        tempT3D.setRotationScale(m1);
                        tempTG.setTransform(tempT3D);

Upon running and pressing the button,i get a:
RestrictedAccessException:Cannot get the parent of a live or a compiled
node.

Thanks!




__________________________________
www.edsamail.com

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