1 Reply Latest reply: Dec 2, 2010 3:11 AM by InteractiveMesh RSS

    TransformGroup removeChild doesn't work

    819542
      I've create a simple java3d application.

      I've put an sphere in an transformgroup who is in the branchgroup.
      on canvas keypress i wanna remove the sphere.

      {
      BranchGroup objRoot = new BranchgGroup();
      TransformGroup objTrans = new TransformGroup();
      objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

      Sphere s = new Sphere(.1f);

      objTrans.addChild(s);

      objRoot.addChild(objTrans);
      objRoot.compile();
      }

      { //the Canvas onKeyPress event
      objTrans.removeChild(s);
      }

      Does someone know why this application doesn't work?

      Thanks,
      Dennis