Title: RE: [JAVA3D] Question with rotation

I have made a realy complicated branchgraph ( i think).

It is a human body.

My problem is the following.

In my navigator class i search for the respective transform groups (head, shoulder etc.)

After finding them i would like to rotate i.e. the head, but before it starts rotating it jumps at the 0,0,0 coords and after this he starts to rotate.

Please help.

Ps. Forgive me for my bad English


And here is the code with the problem:

public void forward() {

    tagok = tg.getAllChildren();

    Object ob = null;

    while (tagok.hasMoreElements()) {

      ob = tagok.nextElement();

      if (ob instanceof Has) {

        has = (Has) ob;

      }

    }

    tagok = has.getAllChildren();

    while (tagok.hasMoreElements()) {

      ob = tagok.nextElement();

      if (ob instanceof Vall) {

        vall = (Vall) ob;

      }

      if (ob instanceof JobbKar) {

        jobbKar = (JobbKar) ob;

      }

      if (ob instanceof BalKar) {

        balKar = (BalKar) ob;

      }

      if (ob instanceof BalComb) {

        balComb = (BalComb) ob;

      }

      if (ob instanceof JobbComb) {

        jobbComb = (JobbComb) ob;

      }

    }

    angle += 0.01;

    Vector3d translation = new Vector3d();

    System.out.println("Eloszor:"+t3d);

    jobbComb.getTransform(t3d);

    Vector3d vector3d = new Vector3d();

    t3d.get(translation);//eredeti helye

    vector3d.x += angle;

    t3d.setTranslation(translation);   

    t3d.setEuler(vector3d);

    jobbComb.setTransform(t3d);  }

}

Reply via email to