I dont get it, attached nodes rotation

if i have Node A and node B attached to it.



Then should Node B rotate as shown in the Picture or?



What is the correct way then to change the Distance between A and B (moving b)

It should be setlocalTranslation(morethenbefore,0,0) ?





If the above is all true, why does this not work?



Node RotationWorld = new Node("RotationWorld");
Node RotationCenter = new Node("RotationCenter");
Node RotationCameraPosition = new Node("RotationCameraPosition");
RotationWorld.attachChild(RotationCenter);
RotationCenter.attachChild(RotationCameraPosition);
RotationCameraPosition.setLocalTranslation(0,100,0);



If I do this we have A (RotationCenter) and B(RotationCameraPosition)
if I now rotate A everything is as expected and as shown in the picture.

However after the RotationCenter is not at the default rotation, RotationCameraPosition.setLocalTranslation(0,1000,0); dor example set the node a the position.
But then it seems to only clone the Rotation as if it were not attached.

Any help would be appreciated, since I don#t know what I'm doing wrong.
Empire Phoenix said:

Hm works now. I had an error in my code, I was unable to find, untill programming the testcase helped me finding it.


I have never heard a better definition of "bugfixing" ;)

It might be worth creating a simplegame test to illustrate the situation better, as Im not sure I got it right.



Most of your assumptions seem to be correct.

I think you might be off on your use of setLocalTranslation though. It will place the node exactly where you say, relative to the position of the parent only. If you subsequently rotate the parent then it will rotate too.

But if you have rotated the parent before setLocalTranslation, that won't affect it.

Hm works now. I had an error in my code, I was unable to find, untill programming the testcase helped me finding it. (I forgot that one of my functions sets the camera to a false position for one frame, and had it being called i every update,cause i havn't thought of this.)