0 Replies Latest reply on Dec 22, 2010 7:08 PM by 808188

    Losing TranformGroup initial value for Y axis on setting X and Z

      I have a beginner question. I'm also not using technical graphics terms. I have a robot which I'm setting on (0,1.45,0) and then I'm moving it like this:
      public  boolean moveBy(double x, double z)
          /* Move the sprite by offsets x and z, but only if within the floor
           and there is no obstacle nearby. */
              if (isActive()) {
                  Point3d nextLoc = tryMove(new Vector3d(x, 0, z));
                  if (obs.nearObstacle(nextLoc, radius*OBS_FACTOR))
                      return false;
                  else {
                      doMove( new Vector3d(x, 0, z) );   // inefficient recalc
                      return true;
              else    // not active
                  return false;
          }  // end of moveBy()
      Accessing TG for that robot, I always see 0 at y axis (x,0,y)
      public TransformGroup getTG()
              return objectTG;
      but I want the same value when I get that TG after applying movement on this robot as shown


      so what can I do before returning TG or where that y value which I set as initial for y why is it returning y=0?

      I want "y" to always return the value I set initially; irrespective of the x and z of TG.

      i believe that there is some function which can return value of TG with current value of X Y Z and by that i can get the initial/current value of Y which needs not be changed and that is need or how can i set the Y without translating the Y (robot high above the plane),i believe i can do that also with some function