Three.js: Adding and Removing Children of Rotated Objects
The trick is to make use of THREE.Object3D.attach(). You need to begin with all your 27 cubes as a child of the scene. Let pivot be an Object3D(). Let active be an array containing the 9 cubes you want to rotate. Now make the cubes a child of the pivot: pivot.rotation.set( 0, 0, 0 ); … Read more