I need to transfer an object from one group (or world/scene) to another group while maintaining its global transformation. I want the object to appear unchanged.
Here is an example of what I am trying to achieve:
//store the current world transformation
var origWorldMatrix = myObject.matrixWorld.clone();
//move the object to a group (positioned and rotated arbitrarily)
someGroup.add(myObject);
//restore the previous world transformation
myObject.matrixWorld.copy(origWorldMatrix);
Unfortunately, this method does not seem to work. I believe this is because the world matrix is constantly updated in the next frame based on the local properties of position, rotation, and scale. I have attempted to use matrixAutoUpdate = false, but that has also proved ineffective.
It seems like achieving the desired result should be straightforward, so I must be overlooking something obvious. Can anyone provide me with some guidance on how to accomplish this?
Thank you!