transformControls with multiple mesh

My main objective is to move multiple mesh with transformControls.

Below image is structure of my scene.

image

I want to transform multiple groups which I selected using raycasting with transformControls.

As I know there is no way to attach transformControls for multiple object.

that is why, I have to create temporary group which has all selected group as child.

And attach transformControls to this tempGroup.

for that I have to create tempGroup in Object-1 & move all selected group in ttempGroup.

Questions:-
1)Is there any suggestion regarding this whole process.

2)is there any method we can move object from its parent to another object.

3)if I create tempGroup & clone group3 & group5 in add it to tempGroup , it it right way to achieve point no 2.

You say,

You can.

here is an example where I attach it to a gtlf scene which contains many meshes and also animations.

TransformControls with GLTF Animations - Three.js Tutorials (sbcode.net)

The hierarchy of your model within the threejs scene is completely within your control.

Yes , right.
But in this example you attach transform controls to scene which is single object and all other object and meshes are children of that object.

but I want to move multiple object which is not children of object.
so I have to first move multiple objects into single object and than attach transformControls to it.

Here is an example of the threejs editor transforming a group.

The Group is the object that is selected and being transformed in this screen grab.

Hi, I also encountered this problem.
Currently i’m try to use the following steps to solve:

1. Create an Array save
2. Create tempGroup and attach transformControls to this tempGroup.
3. Transform tempGroup.
4. Iterate this Array and apply tempGroup’s transform for each one.

But i haven’t achieved it yet and don’t know if it’s feasible. :rofl:

1 Like

Yes! you are right.
I already done that and it works fine.

Hi, could you maybe show your code?