www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: kiffa on August 27, 2012, 04:17:46 pm

Title: How does the (Object3D)parent affect the children?
Post by: kiffa on August 27, 2012, 04:17:46 pm
My codes:

Code: [Select]
   
    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?
Title: Re: How does the (Object3D)parent affect the children?
Post by: EgonOlsen on August 27, 2012, 09:39:09 pm
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.