How does the (Object3D)parent affect the children?

Started by kiffa, August 27, 2012, 04:17:46 PM

Previous topic - Next topic

kiffa

My codes:

   
    Object3D mDog = xxxxxx; //Loader init
    Object3D obj =  Object3D.createDummyObj();
    obj.addChild(mDog);
    obj.addChild(otherObjs);
    obj.rotateY(1);

   if(mDog.getRotationMatrix().isIdentity()){
      log.d("xx", "true");
  };

   if(mDog.getTranslationMatrix().isIdentity()){
      log.d("xx", "true2");
  };



The result is "true"、"true2".

I want to reset "mDog" to its original position after "obj.rotateY(1)",  and the code "mDog.clearRotation()" is useless. Doesn't the rotation of the parent-Object3D affect the RotationMatrix of children-Object3D?

EgonOlsen

The rotation of the parent affects the ROTATION of the child object but not it's ROTATION MATRIX. I.e. each object has it's own, separate rotation matrix but the world transformation of a child takes the parent't transformation into account.